On Thu, Jun 07, 2018 at 01:00:48PM +0200, Sergio Paracuellos wrote:
> This commit silence checkpatch warnings about lines which
> exceeds 80 chars. In some cases to improve code redability
> temporal 'size' variable has been included and assigned before
> allocations.

I would argue that it slightly hurts readability to introduce these one
time use variables.

> @@ -283,7 +285,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
>       }
>  
>       /* allocate the group names array needed by the gpio function */
> -     p->group_names = devm_kzalloc(p->dev, sizeof(char *) * p->group_count, 
> GFP_KERNEL);
> +     size = sizeof(char *) * p->group_count;
> +     p->group_names = devm_kzalloc(p->dev, size, GFP_KERNEL);

Anyway, all of these should be devm_kcalloc() so we'll have to remove
the size var eventually so this change seems like a step backward.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to