All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/hwmon/nct7802.c:714:46: warning: & has lower precedence than !=; != will be evaluated first
@ 2021-09-27 23:41 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-09-27 23:41 UTC (permalink / raw)
  To: Oskar Senft; +Cc: llvm, kbuild-all, linux-kernel, 0day robot

[-- 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, &reg);
   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, &reg);
   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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/hwmon/nct7802.c:714:46: warning: & has lower precedence than !=; != will be evaluated first
@ 2021-09-27 23:41 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-09-27 23:41 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3588 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, &reg);
   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, &reg);
   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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34193 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-27 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 23:41 drivers/hwmon/nct7802.c:714:46: warning: & has lower precedence than !=; != will be evaluated first kernel test robot
2021-09-27 23:41 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.