Hi Guenter,
On 7/21/22 05:41, kernel test robot wrote:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head: 5668b5e6cffd975632ee6c32802d7d877b98e9a4
commit: 7024d59f146ea99d95b7f238e9991f32f31496b0 [77/79] hwmon: (tps23861) fix byte order in current and voltage registers
config: alpha-randconfig-s053-20220720 (https://download.01.org/0day-ci/archive/20220721/202207211843.3aLaNmh9-lkp@xxxxxxxxx/config)
compiler: alpha-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://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?id=7024d59f146ea99d95b7f238e9991f32f31496b0
git remote add groeck-staging https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
git fetch --no-tags groeck-staging hwmon-next
git checkout 7024d59f146ea99d95b7f238e9991f32f31496b0
# 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=alpha SHELL=/bin/bash drivers/hwmon/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16
drivers/hwmon/tps23861.c:184:19: sparse: sparse: cast to restricted __le16
I'm sorry about this. These warnings caught me by surprise. I checked
that changing the type from "uint16_t" to "__le16" silences sparse. It
feels like a false positive. Should I worry about this?
Alex
vim +159 drivers/hwmon/tps23861.c
139
140 static int tps23861_read_voltage(struct tps23861_data *data, int channel,
141 long *val)
142 {
143 uint16_t regval;
144 long raw_val;
145 int err;
146
147 if (channel < TPS23861_NUM_PORTS) {
148 err = regmap_bulk_read(data->regmap,
149 PORT_1_VOLTAGE_LSB + channel * PORT_N_VOLTAGE_LSB_OFFSET,
150 ®val, 2);
151 } else {
152 err = regmap_bulk_read(data->regmap,
153 INPUT_VOLTAGE_LSB,
154 ®val, 2);
155 }
156 if (err < 0)
157 return err;
158
> 159 raw_val = le16_to_cpu(regval);
160 *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * VOLTAGE_LSB) / 1000;
161
162 return 0;
163 }
164