[PATCH 34/34] iio: inkern: fix coding style warnings
Nuno Sá
noname.nuno at gmail.com
Mon Jun 13 00:23:16 PDT 2022
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 at gmail.com>
> 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 at analog.com>
>
> > > > --- 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á
More information about the Linux-mediatek
mailing list