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>] [day] [month] [year] [list]
Message-ID: <202109280602.TyjKpNIJ-lkp@intel.com>
Date:   Tue, 28 Sep 2021 06:51:05 +0800
From:   kernel test robot <lkp@...el.com>
To:     Oskar Senft <osk@...gle.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        0day robot <lkp@...el.com>
Subject: drivers/hwmon/nct7802.c:714:53: warning: suggest parentheses around
 comparison in operand of '&'

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: arc-randconfig-r043-20210927 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/hwmon/nct7802.c: In function 'nct7802_temp_is_visible':
>> drivers/hwmon/nct7802.c:714:53: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
     714 |             (reg >> MODE_BIT_OFFSET_RTD(index / 10) & MODE_RTD_MASK != 0x02))
         |                                                     ^


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

Download attachment ".config.gz" of type "application/gzip" (39416 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ