Content-Type: multipart/mixed; boundary="===============6382492372874111938==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [RFC PATCH 2/2] hwmon: (scmi) Filter out results wrongly interpreted as negatives Date: Tue, 21 Dec 2021 11:54:53 +0800 Message-ID: <202112211141.DiW591Y0-lkp@intel.com> In-Reply-To: <20211220174155.40239-3-cristian.marussi@arm.com> List-Id: --===============6382492372874111938== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Cristian, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on linux/master] [also build test WARNING on groeck-staging/hwmon-next soc/for-next linus/ma= ster v5.16-rc6 next-20211220] [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] url: https://github.com/0day-ci/linux/commits/Cristian-Marussi/Sensor-re= adings-fixes/20211221-014235 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = 136057256686de39cc3a07c2e39ef6bc43003ff6 config: arm-randconfig-r031-20211220 (https://download.01.org/0day-ci/archi= ve/20211221/202112211141.DiW591Y0-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 555eac= f75f21cd1dfc6363d73ad187b730349543) reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/0day-ci/linux/commit/6a3ccc22734d65dfe13f598a7= 469c4ca3094eeea git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Cristian-Marussi/Sensor-readings-f= ixes/20211221-014235 git checkout 6a3ccc22734d65dfe13f598a7469c4ca3094eeea # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Darm SHELL=3D/bin/bash drivers/hwmon/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/hwmon/scmi-hwmon.c:88:14: warning: shift count >=3D width of typ= e [-Wshift-count-overflow] if (value & BIT(63)) { ^~~~~~~ include/vdso/bits.h:7:26: note: expanded from macro 'BIT' #define BIT(nr) (UL(1) << (nr)) ^ ~~~~ 1 warning generated. vim +88 drivers/hwmon/scmi-hwmon.c 66 = 67 static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_typ= es type, 68 u32 attr, int channel, long *val) 69 { 70 int ret; 71 u64 value; 72 const struct scmi_sensor_info *sensor; 73 struct scmi_sensors *scmi_sensors =3D dev_get_drvdata(dev); 74 = 75 sensor =3D *(scmi_sensors->info[type] + channel); 76 /* 77 * Can fail with EIO if the backing SCMI Sensor FW version tried to 78 * report a negative value. 79 */ 80 ret =3D sensor_ops->reading_get(scmi_sensors->ph, sensor->id, &valu= e); 81 if (ret) 82 return ret; 83 = 84 /* 85 * Cannot accept either valid positive values so big that would be 86 * interpreted as negative by HWMON signed long *val return value. 87 */ > 88 if (value & BIT(63)) { 89 dev_warn_once(dev, 90 "Reported unsigned value too big.\n"); 91 return -EIO; 92 } 93 = 94 ret =3D scmi_hwmon_scale(sensor, &value); 95 if (!ret) 96 *val =3D value; 97 = 98 return ret; 99 } 100 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============6382492372874111938==--