lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 7 Jan 2024 21:46:24 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: wens@...e.org
Cc: kernel test robot <lkp@...el.com>, Aidan MacDonald <aidanmacdonald.0x0@...il.com>, 
	oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y

On Sun, Jan 7, 2024 at 7:37 AM Chen-Yu Tsai <wens@...e.org> wrote:
> On Sun, Jan 7, 2024 at 9:30 AM kernel test robot <lkp@...el.com> wrote:

...

> > sparse warnings: (new ones prefixed by >>)
> > >> drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y
> >    drivers/iio/adc/axp20x_adc.c:577:26: sparse: sparse: dubious: x & !y
>
> This looks like a false positive. The code is doing exactly what we want:
> val = val ? 1 : 0, but in a shorter format.

Yes, but the problem is that FIELD_PREP() is a macro.
You can replace these by ternary (here and in other cases) to satisfy
sparse. Compiler will optimize that anyway, so no branch is expected
in the generated code.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ