From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Paller, Kim Seer" <KimSeer.Paller@analog.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>,
kernel test robot <lkp@intel.com>
Subject: Re: [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsi...
Date: Wed, 21 Jun 2023 13:05:52 +0100 [thread overview]
Message-ID: <20230621130552.00001574@Huawei.com> (raw)
In-Reply-To: <010ac7c3707f4eb0aef285b5e823f8e3@analog.com>
On Wed, 21 Jun 2023 08:58:47 +0000
"Paller, Kim Seer" <KimSeer.Paller@analog.com> wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Sent: Wednesday, June 21, 2023 4:25 PM
> > To: kernel test robot <lkp@intel.com>
> > Cc: Paller, Kim Seer <KimSeer.Paller@analog.com>; llvm@lists.linux.dev; oe-
> > kbuild-all@lists.linux.dev; Jonathan Cameron
> > <Jonathan.Cameron@huawei.com>
> > Subject: Re: [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13:
> > warning: result of comparison of constant 18446744073709551615 with
> > expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned
> > char: (unsigned char)0, signed char: (unsi...
> >
> > [External]
> >
> > On Wed, Jun 21, 2023 at 10:19 AM kernel test robot <lkp@intel.com> wrote:
> > >
> > > tree:
> > https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/ji
> > c23/iio.git__;!!A3Ni8CS0y2Y!45o_-MMr4xq4e_9PWpK-sQ_qHBbFbbS7Q2J-
> > fNmTvSPAQXjYhpLYDteGHSeWEbdIAv364HiQBQy2tXMdnz3oesPJvyDEVg$
> > testing
> > > head: 25e201cc6ff270abc062e13ff912292097cb2827
> > > commit: d3e93b67f934a477c5851d575a2278f07c6242fb [6/10] iio: adc:
> > > max14001: New driver
> > > config: x86_64-allyesconfig
> > > (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/2
> > > 0230621/202306211545.7b6CdqsL-
> > lkp@intel.com/config__;!!A3Ni8CS0y2Y!45o
> > > _-MMr4xq4e_9PWpK-sQ_qHBbFbbS7Q2J-
> > fNmTvSPAQXjYhpLYDteGHSeWEbdIAv364HiQB
> > > Qy2tXMdnz3oesOgKhx9ZQ$ )
> > > compiler: clang version 15.0.7
> > > (https://urldefense.com/v3/__https://github.com/llvm/llvm-project.git_
> > > _;!!A3Ni8CS0y2Y!45o_-MMr4xq4e_9PWpK-sQ_qHBbFbbS7Q2J-
> > fNmTvSPAQXjYhpLYDt
> > > eGHSeWEbdIAv364HiQBQy2tXMdnz3oesOx97mL0Q$
> > > 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
> > > reproduce:
> > > (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/2
> > > 0230621/202306211545.7b6CdqsL-
> > lkp@intel.com/reproduce__;!!A3Ni8CS0y2Y!
> > > 45o_-MMr4xq4e_9PWpK-sQ_qHBbFbbS7Q2J-
> > fNmTvSPAQXjYhpLYDteGHSeWEbdIAv364H
> > > iQBQy2tXMdnz3oesODMiAFrg$ )
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new
> > > version of the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes:
> > > | https://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-all/20
> > > | 2306211545.7b6CdqsL-lkp@intel.com/__;!!A3Ni8CS0y2Y!45o_-
> > MMr4xq4e_9PW
> > > | pK-sQ_qHBbFbbS7Q2J-
> > fNmTvSPAQXjYhpLYDteGHSeWEbdIAv364HiQBQy2tXMdnz3oe
> > > | sOVGB0hTQ$
> > >
> > > All warnings (new ones prefixed by >>):
> >
> > Okay, you even haven't compiled your code :-( This should probably use one of
> > the functions from bitfield.h.
> > Like u32_encode_bits().
>
> I wasn’t able to encounter and trigger this kind of warning in my build. I built
> and tested the code with rpi4 and linux kernel source tree before sending the patch.
> Perhaps I missed something. I will check and try to resolve this warning.
Also passed my (admittedly limited these days as 0-day does such a good job) local
build tests.
I guess some / most compilers could see it is constant, but a less observant
one apparently doesn't.
It's only called from one place, I'd just put the code inline so that the
constant nature of that variable is explicit. Or pass in the FIELD_PREP()
value rather than computing it in the function.
Send a new version and I'll switch it in for the one in the tree currently.
However, it looks like that code was meant to do a read modify write cycle and
doesn't use the value read. So probably a bug there anyway.
Thanks,
Jonathan
>
> Thanks and best regards,
> Kim Seer Paller
>
>
>
next prev parent reply other threads:[~2023-06-21 12:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 7:18 [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (un kernel test robot
2023-06-21 8:25 ` Andy Shevchenko
2023-06-21 8:58 ` [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsi Paller, Kim Seer
2023-06-21 12:05 ` Jonathan Cameron [this message]
2023-06-22 12:52 ` Paller, Kim Seer
2023-07-21 8:38 ` Arnd Bergmann
2023-07-20 9:29 ` [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (un Arnd Bergmann
2023-07-20 18:18 ` Jonathan Cameron
2023-07-20 18:22 ` Jonathan Cameron
2023-07-21 7:36 ` [jic23-iio:testing 6/10] drivers/iio/adc/max14001.c:135:13: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((mask), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsi Paller, Kim Seer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230621130552.00001574@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=KimSeer.Paller@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox