[PATCH 07/18] staging: mt7621-pinctrl: avoid lines over 80 chars
Sergio Paracuellos
sergio.paracuellos at gmail.com
Fri Jun 8 11:26:54 UTC 2018
On Fri, Jun 08, 2018 at 02:20:20PM +0300, Dan Carpenter wrote:
> 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.
You are right. I'll fix this. Thanks for pointing this out.
>
> regards,
> dan carpenter
>
Best regards,
Sergio Paracuellos
More information about the devel
mailing list