RE: [PATCH v2 15/15] iio: inkern: fix coding style warnings

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

 



Hi Andy,

> Subject: Re: [PATCH v2 15/15] iio: inkern: fix coding style warnings
> 
> On Mon, Jul 11, 2022 at 2:40 PM Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
> >
> > Just cosmetics. No functional change intended...
> 
> ...
> 
> > -       if (name == NULL && channel_name == NULL)
> > +       if (!name && !channel_name)
> >                 return ERR_PTR(-ENODEV);
> 
> After this change in place, I think it's better to convert it to
> 
>   if (!(name || channel_name))

It should be name && channel_name

See below.
 (! ( 1 || 0)->  (! (1 && 1)

Cheers,
Biju

> 
> which shows intentions clearer.
> 
> --
> With Best Regards,
> Andy Shevchenko




[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