[PATCH linux-next] phy: broadcom: use function devm_kcalloc() instead of devm_kzalloc()

Vinod Koul vkoul at kernel.org
Mon Sep 19 23:20:45 PDT 2022


On 16-09-22, 06:21, cgel.zte at gmail.com wrote:
> From: ye xingchen <ye.xingchen at zte.com.cn>
> 
> Use 2-factor multiplication argument form devm_kcalloc() instead
> of devm_kzalloc().
> 
> Reported-by: Zeal Robot <zealci at zte.com.cn>

Where is this report?

> Signed-off-by: ye xingchen <ye.xingchen at zte.com.cn>
> ---
>  drivers/phy/broadcom/phy-bcm-sr-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/broadcom/phy-bcm-sr-usb.c b/drivers/phy/broadcom/phy-bcm-sr-usb.c
> index 0002da3b5b5d..0d393e0cc7bb 100644
> --- a/drivers/phy/broadcom/phy-bcm-sr-usb.c
> +++ b/drivers/phy/broadcom/phy-bcm-sr-usb.c
> @@ -236,7 +236,7 @@ static int bcm_usb_phy_create(struct device *dev, struct device_node *node,
>  	int idx;
>  
>  	if (version == BCM_SR_USB_COMBO_PHY) {
> -		phy_cfg = devm_kzalloc(dev, NUM_BCM_SR_USB_COMBO_PHYS *
> +		phy_cfg = devm_kcalloc(dev, NUM_BCM_SR_USB_COMBO_PHYS,
>  				       sizeof(struct bcm_usb_phy_cfg),
>  				       GFP_KERNEL);
>  		if (!phy_cfg)
> -- 
> 2.25.1

-- 
~Vinod



More information about the linux-phy mailing list