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

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

 



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,}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux