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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210292127.SyVNpy0K-lkp@intel.com>
Date:   Sat, 29 Oct 2022 21:45:03 +0800
From:   kernel test robot <lkp@...el.com>
To:     Gwan-gyeong Mun <gwan-gyeong.mun@...el.com>,
        ndesaulniers@...gle.com
Cc:     oe-kbuild-all@...ts.linux.dev, peterz@...radead.org,
        llvm@...ts.linux.dev, ashutosh.dixit@...el.com,
        andi.shyti@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bitfield: Use argument type for size comparison on
 Bitfield access macros

Hi Gwan-gyeong,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.1-rc2 next-20221028]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gwan-gyeong-Mun/bitfield-Use-argument-type-for-size-comparison-on-Bitfield-access-macros/20221029-133640
patch link:    https://lore.kernel.org/r/20221029053429.38381-1-gwan-gyeong.mun%40intel.com
patch subject: [PATCH] bitfield: Use argument type for size comparison on Bitfield access macros
config: s390-randconfig-s042-20221029
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/91f22fce5cc0639c001bcf755c9dec0913073876
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Gwan-gyeong-Mun/bitfield-Use-argument-type-for-size-comparison-on-Bitfield-access-macros/20221029-133640
        git checkout 91f22fce5cc0639c001bcf755c9dec0913073876
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash drivers/iio/accel/

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

sparse warnings: (new ones prefixed by >>)
>> drivers/iio/accel/bma400_core.c:1654:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1660:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1668:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1676:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1679:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1690:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
   drivers/iio/accel/bma400_core.c:1712:13: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)

vim +1654 drivers/iio/accel/bma400_core.c

ffe0ab6a96988d Jagath Jog J 2022-05-05  1629  
ffe0ab6a96988d Jagath Jog J 2022-05-05  1630  static irqreturn_t bma400_interrupt(int irq, void *private)
ffe0ab6a96988d Jagath Jog J 2022-05-05  1631  {
ffe0ab6a96988d Jagath Jog J 2022-05-05  1632  	struct iio_dev *indio_dev = private;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1633  	struct bma400_data *data = iio_priv(indio_dev);
d024af5b3970b9 Jagath Jog J 2022-05-05  1634  	s64 timestamp = iio_get_time_ns(indio_dev);
3cf122c20bf835 Jagath Jog J 2022-05-05  1635  	unsigned int act, ev_dir = IIO_EV_DIR_NONE;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1636  	int ret;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1637  
ffe0ab6a96988d Jagath Jog J 2022-05-05  1638  	/* Lock to protect the data->status */
ffe0ab6a96988d Jagath Jog J 2022-05-05  1639  	mutex_lock(&data->mutex);
ffe0ab6a96988d Jagath Jog J 2022-05-05  1640  	ret = regmap_bulk_read(data->regmap, BMA400_INT_STAT0_REG,
ffe0ab6a96988d Jagath Jog J 2022-05-05  1641  			       &data->status,
ffe0ab6a96988d Jagath Jog J 2022-05-05  1642  			       sizeof(data->status));
ffe0ab6a96988d Jagath Jog J 2022-05-05  1643  	/*
ffe0ab6a96988d Jagath Jog J 2022-05-05  1644  	 * if none of the bit is set in the status register then it is
ffe0ab6a96988d Jagath Jog J 2022-05-05  1645  	 * spurious interrupt.
ffe0ab6a96988d Jagath Jog J 2022-05-05  1646  	 */
ffe0ab6a96988d Jagath Jog J 2022-05-05  1647  	if (ret || !data->status)
ffe0ab6a96988d Jagath Jog J 2022-05-05  1648  		goto unlock_err;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1649  
961db2da159d51 Jagath Jog J 2022-08-31  1650  	/*
961db2da159d51 Jagath Jog J 2022-08-31  1651  	 * Disable all advance interrupts if interrupt engine overrun occurs.
961db2da159d51 Jagath Jog J 2022-08-31  1652  	 * See section 4.7 "Interrupt engine overrun" in datasheet v1.2.
961db2da159d51 Jagath Jog J 2022-08-31  1653  	 */
961db2da159d51 Jagath Jog J 2022-08-31 @1654  	if (FIELD_GET(BMA400_INT_ENG_OVRUN_MSK, le16_to_cpu(data->status))) {
961db2da159d51 Jagath Jog J 2022-08-31  1655  		bma400_disable_adv_interrupt(data);
961db2da159d51 Jagath Jog J 2022-08-31  1656  		dev_err(data->dev, "Interrupt engine overrun\n");
961db2da159d51 Jagath Jog J 2022-08-31  1657  		goto unlock_err;
961db2da159d51 Jagath Jog J 2022-08-31  1658  	}
961db2da159d51 Jagath Jog J 2022-08-31  1659  
961db2da159d51 Jagath Jog J 2022-08-31  1660  	if (FIELD_GET(BMA400_INT_S_TAP_MSK, le16_to_cpu(data->status)))
961db2da159d51 Jagath Jog J 2022-08-31  1661  		iio_push_event(indio_dev,
961db2da159d51 Jagath Jog J 2022-08-31  1662  			       IIO_MOD_EVENT_CODE(IIO_ACCEL, 0,
961db2da159d51 Jagath Jog J 2022-08-31  1663  						  IIO_MOD_X_OR_Y_OR_Z,
961db2da159d51 Jagath Jog J 2022-08-31  1664  						  IIO_EV_TYPE_GESTURE,
961db2da159d51 Jagath Jog J 2022-08-31  1665  						  IIO_EV_DIR_SINGLETAP),
961db2da159d51 Jagath Jog J 2022-08-31  1666  			       timestamp);
961db2da159d51 Jagath Jog J 2022-08-31  1667  
961db2da159d51 Jagath Jog J 2022-08-31  1668  	if (FIELD_GET(BMA400_INT_D_TAP_MSK, le16_to_cpu(data->status)))
961db2da159d51 Jagath Jog J 2022-08-31  1669  		iio_push_event(indio_dev,
961db2da159d51 Jagath Jog J 2022-08-31  1670  			       IIO_MOD_EVENT_CODE(IIO_ACCEL, 0,
961db2da159d51 Jagath Jog J 2022-08-31  1671  						  IIO_MOD_X_OR_Y_OR_Z,
961db2da159d51 Jagath Jog J 2022-08-31  1672  						  IIO_EV_TYPE_GESTURE,
961db2da159d51 Jagath Jog J 2022-08-31  1673  						  IIO_EV_DIR_DOUBLETAP),
961db2da159d51 Jagath Jog J 2022-08-31  1674  			       timestamp);
961db2da159d51 Jagath Jog J 2022-08-31  1675  
3cf122c20bf835 Jagath Jog J 2022-05-05  1676  	if (FIELD_GET(BMA400_INT_GEN1_MSK, le16_to_cpu(data->status)))
3cf122c20bf835 Jagath Jog J 2022-05-05  1677  		ev_dir = IIO_EV_DIR_RISING;
3cf122c20bf835 Jagath Jog J 2022-05-05  1678  
3cf122c20bf835 Jagath Jog J 2022-05-05  1679  	if (FIELD_GET(BMA400_INT_GEN2_MSK, le16_to_cpu(data->status)))
3cf122c20bf835 Jagath Jog J 2022-05-05  1680  		ev_dir = IIO_EV_DIR_FALLING;
3cf122c20bf835 Jagath Jog J 2022-05-05  1681  
3cf122c20bf835 Jagath Jog J 2022-05-05  1682  	if (ev_dir != IIO_EV_DIR_NONE) {
3cf122c20bf835 Jagath Jog J 2022-05-05  1683  		iio_push_event(indio_dev,
3cf122c20bf835 Jagath Jog J 2022-05-05  1684  			       IIO_MOD_EVENT_CODE(IIO_ACCEL, 0,
3cf122c20bf835 Jagath Jog J 2022-05-05  1685  						  IIO_MOD_X_OR_Y_OR_Z,
3cf122c20bf835 Jagath Jog J 2022-05-05  1686  						  IIO_EV_TYPE_MAG, ev_dir),
3cf122c20bf835 Jagath Jog J 2022-05-05  1687  			       timestamp);
3cf122c20bf835 Jagath Jog J 2022-05-05  1688  	}
3cf122c20bf835 Jagath Jog J 2022-05-05  1689  
d024af5b3970b9 Jagath Jog J 2022-05-05  1690  	if (FIELD_GET(BMA400_STEP_STAT_MASK, le16_to_cpu(data->status))) {
d024af5b3970b9 Jagath Jog J 2022-05-05  1691  		iio_push_event(indio_dev,
d024af5b3970b9 Jagath Jog J 2022-05-05  1692  			       IIO_MOD_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD,
d024af5b3970b9 Jagath Jog J 2022-05-05  1693  						  IIO_EV_TYPE_CHANGE,
d024af5b3970b9 Jagath Jog J 2022-05-05  1694  						  IIO_EV_DIR_NONE),
d024af5b3970b9 Jagath Jog J 2022-05-05  1695  			       timestamp);
00ee658ff58177 Jagath Jog J 2022-05-05  1696  
00ee658ff58177 Jagath Jog J 2022-05-05  1697  		if (data->activity_event_en) {
00ee658ff58177 Jagath Jog J 2022-05-05  1698  			ret = regmap_read(data->regmap, BMA400_STEP_STAT_REG,
00ee658ff58177 Jagath Jog J 2022-05-05  1699  					  &act);
00ee658ff58177 Jagath Jog J 2022-05-05  1700  			if (ret)
00ee658ff58177 Jagath Jog J 2022-05-05  1701  				goto unlock_err;
00ee658ff58177 Jagath Jog J 2022-05-05  1702  
00ee658ff58177 Jagath Jog J 2022-05-05  1703  			iio_push_event(indio_dev,
00ee658ff58177 Jagath Jog J 2022-05-05  1704  				       IIO_MOD_EVENT_CODE(IIO_ACTIVITY, 0,
00ee658ff58177 Jagath Jog J 2022-05-05  1705  							  bma400_act_to_mod(act),
00ee658ff58177 Jagath Jog J 2022-05-05  1706  							  IIO_EV_TYPE_CHANGE,
00ee658ff58177 Jagath Jog J 2022-05-05  1707  							  IIO_EV_DIR_NONE),
00ee658ff58177 Jagath Jog J 2022-05-05  1708  				       timestamp);
00ee658ff58177 Jagath Jog J 2022-05-05  1709  		}
d024af5b3970b9 Jagath Jog J 2022-05-05  1710  	}
d024af5b3970b9 Jagath Jog J 2022-05-05  1711  
ffe0ab6a96988d Jagath Jog J 2022-05-05  1712  	if (FIELD_GET(BMA400_INT_DRDY_MSK, le16_to_cpu(data->status))) {
ffe0ab6a96988d Jagath Jog J 2022-05-05  1713  		mutex_unlock(&data->mutex);
ffe0ab6a96988d Jagath Jog J 2022-05-05  1714  		iio_trigger_poll_chained(data->trig);
ffe0ab6a96988d Jagath Jog J 2022-05-05  1715  		return IRQ_HANDLED;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1716  	}
ffe0ab6a96988d Jagath Jog J 2022-05-05  1717  
d024af5b3970b9 Jagath Jog J 2022-05-05  1718  	mutex_unlock(&data->mutex);
d024af5b3970b9 Jagath Jog J 2022-05-05  1719  	return IRQ_HANDLED;
d024af5b3970b9 Jagath Jog J 2022-05-05  1720  
ffe0ab6a96988d Jagath Jog J 2022-05-05  1721  unlock_err:
ffe0ab6a96988d Jagath Jog J 2022-05-05  1722  	mutex_unlock(&data->mutex);
ffe0ab6a96988d Jagath Jog J 2022-05-05  1723  	return IRQ_NONE;
ffe0ab6a96988d Jagath Jog J 2022-05-05  1724  }
ffe0ab6a96988d Jagath Jog J 2022-05-05  1725  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (140997 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ