Content-Type: multipart/mixed; boundary="===============0192289563621613086==" MIME-Version: 1.0 From: Jagath Jog J To: kbuild-all@lists.01.org Subject: Re: [PATCH v4 9/9] iio: accel: bma400: Add support for activity and inactivity events Date: Wed, 27 Apr 2022 08:31:21 +0530 Message-ID: <20220427030119.GA31584@jagath-PC> In-Reply-To: <20220424172002.7dd48dfa@jic23-huawei> List-Id: --===============0192289563621613086== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hello Jonathan, On Sun, Apr 24, 2022 at 05:20:02PM +0100, Jonathan Cameron wrote: > On Thu, 21 Apr 2022 14:45:05 +0800 > kernel test robot wrote: > = > > Hi Jagath, > > = > > Thank you for the patch! Perhaps something to improve: > > = > > [auto build test WARNING on jic23-iio/togreg] > > [also build test WARNING on linus/master v5.18-rc3 next-20220420] > > [cannot apply to linux/master] > > [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/intel-lab-lkp/linux/commits/Jagath-Jog-J/iio= -accel-bma400-Add-buffer-step-and-activity-inactivity/20220421-051244 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git t= ogreg > > config: mips-randconfig-r031-20220420 (https://download.01.org/0day-ci/= archive/20220421/202204211211.febbJ6fy-lkp(a)intel.com/config) > > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ba= c6cd5bf85669e3376610cfc4c4f9ca015e7b9b) > > reproduce (this is a W=3D1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/s= bin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # install mips cross compiling tool for clang build > > # apt-get install binutils-mips-linux-gnu > > # https://github.com/intel-lab-lkp/linux/commit/b33d9910aa7588e= c8db7c1694dbc03c3ed200ebb > > git remote add linux-review https://github.com/intel-lab-lkp/li= nux > > git fetch --no-tags linux-review Jagath-Jog-J/iio-accel-bma400-= Add-buffer-step-and-activity-inactivity/20220421-051244 > > git checkout b33d9910aa7588ec8db7c1694dbc03c3ed200ebb > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross = W=3D1 O=3Dbuild_dir ARCH=3Dmips SHELL=3D/bin/bash drivers/iio/accel/ > > = > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > = > > All warnings (new ones prefixed by >>): > > = > > >> drivers/iio/accel/bma400_core.c:1047:17: warning: result of comparis= on of constant 18446744073709551615 with expression of type 'typeof (_Gener= ic((msk), char: (unsigned char)0, unsigned char: (unsigned char)0, signed c= har: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned = short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long= : (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned l= ong long)0, long long: (unsigned long long)0, default: (msk)))' (aka 'unsig= ned int') is always false [-Wtautological-constant-out-of-range-compare] = > > field_value =3D FIELD_PREP(msk, state); > > ^~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PRE= P' > > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");= \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:71:53: note: expanded from macro '__BF_FIEL= D_CHECK' > > BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > = \ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~= ~~~~~ > > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BU= G_ON_MSG' > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ > > include/linux/compiler_types.h:352:22: note: expanded from macro 'co= mpiletime_assert' > > _compiletime_assert(condition, msg, __compiletime_assert_, _= _COUNTER__) > > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~ > > include/linux/compiler_types.h:340:23: note: expanded from macro '_c= ompiletime_assert' > > __compiletime_assert(condition, msg, prefix, suffix) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:332:9: note: expanded from macro '__c= ompiletime_assert' > > if (!(condition)) = \ > > ^~~~~~~~~ > > drivers/iio/accel/bma400_core.c:1053:17: warning: result of comparis= on of constant 18446744073709551615 with expression of type 'typeof (_Gener= ic((msk), char: (unsigned char)0, unsigned char: (unsigned char)0, signed c= har: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned = short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long= : (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned l= ong long)0, long long: (unsigned long long)0, default: (msk)))' (aka 'unsig= ned int') is always false [-Wtautological-constant-out-of-range-compare] > > field_value =3D FIELD_PREP(msk, state); > > ^~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PRE= P' > > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");= \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:71:53: note: expanded from macro '__BF_FIEL= D_CHECK' > > BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > = \ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~= ~~~~~ > > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BU= G_ON_MSG' > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ > > include/linux/compiler_types.h:352:22: note: expanded from macro 'co= mpiletime_assert' > > _compiletime_assert(condition, msg, __compiletime_assert_, _= _COUNTER__) > > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~ > > include/linux/compiler_types.h:340:23: note: expanded from macro '_c= ompiletime_assert' > > __compiletime_assert(condition, msg, prefix, suffix) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:332:9: note: expanded from macro '__c= ompiletime_assert' > > if (!(condition)) = \ > > ^~~~~~~~~ > > 2 warnings generated. > > = > > = > > vim +1047 drivers/iio/accel/bma400_core.c > > = > > 1035 = > > 1036 static int bma400_activity_event_en(struct bma400_data *data, > > 1037 enum iio_event_direction dir, > > 1038 int state) > > 1039 { > > 1040 int ret, reg, msk, value, field_value; > > 1041 = > > 1042 switch (dir) { > > 1043 case IIO_EV_DIR_RISING: > > 1044 reg =3D BMA400_GEN1INT_CONFIG0; > > 1045 msk =3D BMA400_INT_GEN1_MSK; > > 1046 value =3D 2; > > > 1047 field_value =3D FIELD_PREP(msk, state); > = > Ah. Will need to clamp state to 0/1 > = > field_value =3D FIELD_PREP(msk, state ? 1 : 0); > perhaps? For this also compiler shows warning. To compile for mips I used COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D1 O=3Dbu= ild_dir ARCH=3Dmips SHELL=3D/bin/bash drivers/iio/accel/ ../drivers/iio/accel/bma400_core.c:1047:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((ms= k)... field_value =3D FIELD_PREP(msk, state ? 1 : 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PREP' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ To avoid warning can I do like this field_value =3D FIELD_PREP(BMA400_INT_GEN1_MSK, state); > = > > 1048 break; > > 1049 case IIO_EV_DIR_FALLING: > > 1050 reg =3D BMA400_GEN2INT_CONFIG0; > > 1051 msk =3D BMA400_INT_GEN2_MSK; > > 1052 value =3D 0; > > 1053 field_value =3D FIELD_PREP(msk, state); > > 1054 break; > > 1055 default: > > 1056 return -EINVAL; > > 1057 } > > 1058 = > > 1059 /* Enabling all axis for interrupt evaluation */ > > 1060 ret =3D regmap_write(data->regmap, reg, 0xF8); > > 1061 if (ret) > > 1062 return ret; > > 1063 = > > 1064 /* OR combination of all axis for interrupt evaluation */ > > 1065 ret =3D regmap_write(data->regmap, reg + BMA400_GEN_CONFIG1_OFF= , value); > > 1066 if (ret) > > 1067 return ret; > > 1068 = > > 1069 /* Initial value to avoid interrupts while enabling*/ > > 1070 ret =3D regmap_write(data->regmap, reg + BMA400_GEN_CONFIG2_OFF= , 0x0A); > > 1071 if (ret) > > 1072 return ret; > > 1073 = > > 1074 /* Initial duration value to avoid interrupts while enabling*/ > > 1075 ret =3D regmap_write(data->regmap, reg + BMA400_GEN_CONFIG31_OF= F, 0x0F); > > 1076 if (ret) > > 1077 return ret; > > 1078 = > > 1079 ret =3D regmap_update_bits(data->regmap, BMA400_INT1_MAP_REG, m= sk, > > 1080 field_value); > > 1081 if (ret) > > 1082 return ret; > > 1083 = > > 1084 ret =3D regmap_update_bits(data->regmap, BMA400_INT_CONFIG0_REG= , msk, > > 1085 field_value); > > 1086 if (ret) > > 1087 return ret; > > 1088 = > > 1089 set_mask_bits(&data->generic_event_en, msk, field_value); > > 1090 return 0; > > 1091 } > > 1092 = > > = > = Thank you, Jagath --===============0192289563621613086==--