From: kernel test robot <lkp@intel.com>
To: Oskar Senft <osk@google.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, 0day robot <lkp@intel.com>
Subject: drivers/hwmon/nct7802.c:714:46: warning: & has lower precedence than !=; != will be evaluated first
Date: Tue, 28 Sep 2021 07:41:38 +0800 [thread overview]
Message-ID: <202109280730.aIAJgQko-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3508 bytes --]
tree: https://github.com/0day-ci/linux/commits/Oskar-Senft/dt-bindings-hwmon-Add-nct7802-bindings/20210922-121927
head: 0654ba359c66a776f243b53f407f200f9e53a9ba
commit: 0654ba359c66a776f243b53f407f200f9e53a9ba hwmon: (nct7802) Make temperature sensors configurable.
date: 6 days ago
config: i386-randconfig-a016-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/0654ba359c66a776f243b53f407f200f9e53a9ba
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Oskar-Senft/dt-bindings-hwmon-Add-nct7802-bindings/20210922-121927
git checkout 0654ba359c66a776f243b53f407f200f9e53a9ba
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/hwmon/nct7802.c:714:46: warning: & has lower precedence than !=; != will be evaluated first [-Wparentheses]
(reg >> MODE_BIT_OFFSET_RTD(index / 10) & MODE_RTD_MASK != 0x02))
^~~~~~~~~~~~~~~~~~~~~~~
drivers/hwmon/nct7802.c:714:46: note: place parentheses around the '!=' expression to silence this warning
(reg >> MODE_BIT_OFFSET_RTD(index / 10) & MODE_RTD_MASK != 0x02))
^ ~~~~~~~~~~~~~~~~~~~~~
drivers/hwmon/nct7802.c:714:46: note: place parentheses around the & expression to evaluate it first
(reg >> MODE_BIT_OFFSET_RTD(index / 10) & MODE_RTD_MASK != 0x02))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
1 warning generated.
vim +714 drivers/hwmon/nct7802.c
695
696 static umode_t nct7802_temp_is_visible(struct kobject *kobj,
697 struct attribute *attr, int index)
698 {
699 struct device *dev = kobj_to_dev(kobj);
700 struct nct7802_data *data = dev_get_drvdata(dev);
701 unsigned int reg;
702 int err;
703
704 err = regmap_read(data->regmap, REG_MODE, ®);
705 if (err < 0)
706 return 0;
707
708 if (index >= 0 && index < 20 && /* RD1, RD 2*/
709 ((reg >> MODE_BIT_OFFSET_RTD(index / 10)) & MODE_RTD_MASK) != 0x01 &&
710 ((reg >> MODE_BIT_OFFSET_RTD(index / 10)) & MODE_RTD_MASK) != 0x02)
711 return 0;
712
713 if (index >= 20 && index < 30 && /* RD3 */
> 714 (reg >> MODE_BIT_OFFSET_RTD(index / 10) & MODE_RTD_MASK != 0x02))
715 return 0;
716
717 if (index >= 30 && index < 38 && /* local */
718 (reg & MODE_LTD_EN) != MODE_LTD_EN)
719 return 0;
720
721 err = regmap_read(data->regmap, REG_PECI_ENABLE, ®);
722 if (err < 0)
723 return 0;
724
725 if (index >= 38 && index < 46 && !(reg & 0x01)) /* PECI 0 */
726 return 0;
727
728 if (index >= 0x46 && (!(reg & 0x02))) /* PECI 1 */
729 return 0;
730
731 return attr->mode;
732 }
733
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34193 bytes --]
reply other threads:[~2021-09-27 23:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202109280730.aIAJgQko-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=osk@google.com \
/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