Re: [PATCH v2 5/6] gpio: thunderx: Utilize for_each_set_clump macro

From: kbuild test robot
Date: Mon Apr 27 2020 - 21:42:39 EST


Hi Syed,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on gpio/for-next]
[also build test WARNING on linus/master asm-generic/master v5.7-rc3 next-20200424]
[cannot apply to xlnx/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Syed-Nayyar-Waris/Introduce-the-for_each_set_clump-macro/20200427-184103
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-191-gc51a0382-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/gpio/gpio-thunderx.c:284:9: sparse: sparse: incorrect type in argument 1 (different type sizes) @@ expected unsigned long *clump @@ got unsigunsigned long *clump @@
>> drivers/gpio/gpio-thunderx.c:284:9: sparse: expected unsigned long *clump
>> drivers/gpio/gpio-thunderx.c:284:9: sparse: got unsigned long long *
>> drivers/gpio/gpio-thunderx.c:284:9: sparse: sparse: incorrect type in argument 1 (different type sizes) @@ expected unsigned long *clump @@ got unsigunsigned long *clump @@
>> drivers/gpio/gpio-thunderx.c:284:9: sparse: expected unsigned long *clump
>> drivers/gpio/gpio-thunderx.c:284:9: sparse: got unsigned long long *

vim +284 drivers/gpio/gpio-thunderx.c

272
273 static void thunderx_gpio_set_multiple(struct gpio_chip *chip,
274 unsigned long *mask,
275 unsigned long *bits)
276 {
277 int bank;
278 u64 set_bits, clear_bits, gpio_mask;
279 const unsigned long bank_size = 64;
280 unsigned long offset;
281
282 struct thunderx_gpio *txgpio = gpiochip_get_data(chip);
283
> 284 for_each_set_clump(offset, gpio_mask, mask, chip->ngpio, bank_size) {
285 bank = offset / bank_size;
286 set_bits = bits[bank] & gpio_mask;
287 clear_bits = ~bits[bank] & gpio_mask;
288 writeq(set_bits, txgpio->register_base + (bank * GPIO_2ND_BANK) + GPIO_TX_SET);
289 writeq(clear_bits, txgpio->register_base + (bank * GPIO_2ND_BANK) + GPIO_TX_CLR);
290 }
291 }
292

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx