Re: [PATCH 34/34] iio: inkern: fix coding style warnings

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

 



On Sun, 2022-06-12 at 19:39 +0200, Geert Uytterhoeven wrote:
> Hi Nuno,
> 
> On Fri, Jun 10, 2022 at 9:52 PM Nuno Sá <noname.nuno@xxxxxxxxx>
> wrote:
> > On Fri, 2022-06-10 at 11:53 -0400, Joe Simmons-Talbott wrote:
> > > On Fri, Jun 10, 2022 at 10:45:45AM +0200, Nuno Sá wrote:
> > > > Just cosmetics. No functional change intended...
> > > > 
> > > > Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> 
> > > > --- a/drivers/iio/inkern.c
> > > > +++ b/drivers/iio/inkern.c
> > > > @@ -45,13 +45,13 @@ int iio_map_array_register(struct iio_dev
> > > > *indio_dev, struct iio_map *maps)
> > > >         int i = 0, ret = 0;
> > > >         struct iio_map_internal *mapi;
> > > > 
> > > > -       if (maps == NULL)
> > > > +       if (!maps)
> > > >                 return 0;
> > > > 
> > > >         mutex_lock(&iio_map_list_lock);
> > > > -       while (maps[i].consumer_dev_name != NULL) {
> > > > +       while (!maps[i].consumer_dev_name) {
> > > 
> > > Shouldn't this be?:
> > > while (maps[i].consumer_dev_name) {
> > 
> > Ups... Nice catch! I was probably in bot mode already.
> 
> When making a change with no functional change intended, it is always
> a good idea to compare the generated assembler before/after.  I.e.
> 
>     make drivers/iio/inkern.s
>     mv drivers/iio/inkern.s drivers/iio/inkern.s.orig
>     [make your change]
>     make drivers/iio/inkern.s
>     diff -u drivers/iio/inkern.s{.orig,}
> 

Ah thx... That's indeed a good idea!

- Nuno Sá








[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux