Re: [PATCH v8 1/4] Input: Add driver for Cypress Generation 5 touchscreen

kernel test robot
2022-08-06T03:53:57Z

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on shawnguo/for-next linus/master v5.19 next-20220805]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20220802-210032
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: um-allmodconfig (https://download.01.org/0day-ci/archive/20220806/202208061128.pfj2DRWO-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/9c372983ef0b8eb7ad48c025a156f80943269af7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20220802-210032
git checkout 9c372983ef0b8eb7ad48c025a156f80943269af7
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_handle_irq':
>> drivers/input/touchscreen/cyttsp5.c:254:31: warning: array subscript 'int[0]' is partly outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
254 | for (nbyte = 0, *axis = 0; nbyte < size; nbyte++)
| ~~~~~~^~~
drivers/input/touchscreen/cyttsp5.c:333:12: note: while referencing 'num_cur_tch'
333 | u8 num_cur_tch;
| ^~~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:257:15: warning: array subscript 'int[0]' is partly outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
257 | *axis &= max - 1;
| ^~
drivers/input/touchscreen/cyttsp5.c:333:12: note: while referencing 'num_cur_tch'
333 | u8 num_cur_tch;
| ^~~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:257:15: warning: array subscript 'int[0]' is partly outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
257 | *axis &= max - 1;
| ~~~~~~^~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:333:12: note: while referencing 'num_cur_tch'
333 | u8 num_cur_tch;
| ^~~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:255:23: warning: array subscript 'int[0]' is partly outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
255 | *axis += ((xy_data[nbyte] >> bofs) << (nbyte * 8));
| ^~
drivers/input/touchscreen/cyttsp5.c:333:12: note: while referencing 'num_cur_tch'
333 | u8 num_cur_tch;
| ^~~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:255:23: warning: array subscript 'int[0]' is partly outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
255 | *axis += ((xy_data[nbyte] >> bofs) << (nbyte * 8));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/touchscreen/cyttsp5.c:333:12: note: while referencing 'num_cur_tch'
333 | u8 num_cur_tch;
| ^~~~~~~~~~~

vim +254 drivers/input/touchscreen/cyttsp5.c

248
249 static void cyttsp5_get_touch_axis(int *axis, int size, int max, u8 *xy_data,
250 int bofs)
251 {
252 int nbyte;
253
> 254 for (nbyte = 0, *axis = 0; nbyte < size; nbyte++)
255 *axis += ((xy_data[nbyte] >> bofs) << (nbyte * 8));
256
257 *axis &= max - 1;
258 }
259

--
0-DAY CI Kernel Test Service