LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place
@ 2015-03-05  1:40 Axel Lin
  2015-03-09 13:02 ` Antoine Tenart
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2015-03-05  1:40 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: Antoine Tenart, linux-kernel

Prefer devm_kcalloc over devm_kzalloc with multiply.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/phy/phy-berlin-sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c
index 099eee8..6f3e06d 100644
--- a/drivers/phy/phy-berlin-sata.c
+++ b/drivers/phy/phy-berlin-sata.c
@@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
 	if (priv->nphys == 0)
 		return -ENODEV;
 
-	priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
+	priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
 				  GFP_KERNEL);
 	if (!priv->phys)
 		return -ENOMEM;
-- 
1.9.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place
  2015-03-05  1:40 [PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place Axel Lin
@ 2015-03-09 13:02 ` Antoine Tenart
  0 siblings, 0 replies; 2+ messages in thread
From: Antoine Tenart @ 2015-03-09 13:02 UTC (permalink / raw)
  To: Axel Lin; +Cc: Kishon Vijay Abraham I, Antoine Tenart, linux-kernel

On Thu, Mar 05, 2015 at 09:40:41AM +0800, Axel Lin wrote:
> Prefer devm_kcalloc over devm_kzalloc with multiply.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>

> ---
>  drivers/phy/phy-berlin-sata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c
> index 099eee8..6f3e06d 100644
> --- a/drivers/phy/phy-berlin-sata.c
> +++ b/drivers/phy/phy-berlin-sata.c
> @@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
>  	if (priv->nphys == 0)
>  		return -ENODEV;
>  
> -	priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
> +	priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
>  				  GFP_KERNEL);
>  	if (!priv->phys)
>  		return -ENOMEM;
> -- 
> 1.9.1
> 
> 
> 

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-09 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05  1:40 [PATCH] phy: berlin-sata: Use devm_kcalloc at appropriate place Axel Lin
2015-03-09 13:02 ` Antoine Tenart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).