* [power-supply:for-next 58/68] drivers/power/supply/max17040_battery.c:231:3: warning: cast to smaller integer type 'enum chip_id' from 'const void
@ 2020-10-04 2:08 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-10-04 2:08 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3239 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
head: 304bff2fb8e9ad0047c11ae0ef2ca6c3d74cd52b
commit: 1779c6e3496a53d9cbbbcd248b234b2b6a07435c [58/68] power: supply: max17040: Support setting rcomp
config: x86_64-randconfig-a015-20201004 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bcd05599d0e53977a963799d6ee4f6e0bc21331b)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git/commit/?id=1779c6e3496a53d9cbbbcd248b234b2b6a07435c
git remote add power-supply https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
git fetch --no-tags power-supply for-next
git checkout 1779c6e3496a53d9cbbbcd248b234b2b6a07435c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/power/supply/max17040_battery.c:231:3: warning: cast to smaller integer type 'enum chip_id' from 'const void *' [-Wvoid-pointer-to-enum-cast]
(enum chip_id) of_device_get_match_data(dev)];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +231 drivers/power/supply/max17040_battery.c
226
227 static int max17040_get_of_data(struct max17040_chip *chip)
228 {
229 struct device *dev = &chip->client->dev;
230 struct chip_data *data = &max17040_family[
> 231 (enum chip_id) of_device_get_match_data(dev)];
232 int rcomp_len;
233 u8 rcomp[2];
234
235 chip->quirk_double_soc = device_property_read_bool(dev,
236 "maxim,double-soc");
237
238 chip->low_soc_alert = MAX17040_ATHD_DEFAULT_POWER_UP;
239 device_property_read_u32(dev,
240 "maxim,alert-low-soc-level",
241 &chip->low_soc_alert);
242
243 if (chip->low_soc_alert <= 0 ||
244 chip->low_soc_alert > (chip->quirk_double_soc ? 16 : 32)) {
245 dev_err(dev, "maxim,alert-low-soc-level out of bounds\n");
246 return -EINVAL;
247 }
248
249 rcomp_len = device_property_count_u8(dev, "maxim,rcomp");
250 chip->rcomp = MAX17040_RCOMP_DEFAULT;
251 if (rcomp_len == data->rcomp_bytes) {
252 device_property_read_u8_array(dev, "maxim,rcomp",
253 rcomp, rcomp_len);
254 chip->rcomp = rcomp_len == 2 ?
255 rcomp[0] << 8 | rcomp[1] :
256 rcomp[0] << 8;
257 } else if (rcomp_len > 0) {
258 dev_err(dev, "maxim,rcomp has incorrect length\n");
259 return -EINVAL;
260 }
261
262 return 0;
263 }
264
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41486 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-04 2:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04 2:08 [power-supply:for-next 58/68] drivers/power/supply/max17040_battery.c:231:3: warning: cast to smaller integer type 'enum chip_id' from 'const void kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.