lkml.org 
[lkml]   [2013]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1.1] gpiolib: append SFI helpers for GPIO API
From
Date
On Sun, 2013-06-02 at 19:06 -0700, Joe Perches wrote: 
> On Mon, 2013-06-03 at 11:59 +1000, Ryan Mallon wrote:
> > On 31/05/13 19:27, Andy Shevchenko wrote:
> > Some trivial coding style comment below.

Thank you, Joe, for commenting this.

> > > + for (i = 0; i < sfi_gpio_num_entry; i++, pentry++) {
> > > + if (!strncmp(name, pentry->pin_name, SFI_NAME_LEN))
> > > + return pentry->pin_no;
> > > + }
> >
> > Nitpick - Don't need the braces on the for loop.
>
> I'm not Andy but I think it's preferable to keep the braces
> when there's an if in the for loop.

This is my point too.

> > > + sfi_gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL);
> >
> > Use kcalloc when you have a size and a count.
>
> kmalloc_array unless you want zero'ed memory

One proposed to use kmemdup to clean up a bit. What do you think?

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy


\
 
 \ /
  Last update: 2013-06-03 11:02    [W:0.136 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site