Re: [PATCH 07/18] staging: mt7621-pinctrl: avoid lines over 80 chars

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux