Re: [PATCH v6 2/2] Input: add Imagis touchscreen driver

From: kernel test robot
Date: Wed Feb 23 2022 - 10:42:46 EST


Hi Markuss,

I love your patch! Perhaps something to improve:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on linux/master robh/for-next linus/master v5.17-rc5 next-20220222]
[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/0day-ci/linux/commits/Markuss-Broks/Add-support-for-Imagis-touchscreens/20220223-043645
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: arm-randconfig-s031-20220223 (https://download.01.org/0day-ci/archive/20220223/202202232342.Ew209GPR-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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-dirty
# https://github.com/0day-ci/linux/commit/bc77ee5e0d7309edca7d65925c6afa05334b0b01
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Markuss-Broks/Add-support-for-Imagis-touchscreens/20220223-043645
git checkout bc77ee5e0d7309edca7d65925c6afa05334b0b01
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/input/touchscreen/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/input/touchscreen/imagis.c:65:35: sparse: sparse: cast to restricted __be32

vim +65 drivers/input/touchscreen/imagis.c

40
41 static int imagis_i2c_read_reg(struct imagis_ts *ts,
42 unsigned int reg, unsigned int *buffer)
43 {
44 __be32 reg_be = cpu_to_be32(reg);
45 struct i2c_msg msg[] = {
46 {
47 .addr = ts->client->addr,
48 .flags = 0,
49 .buf = (unsigned char *)&reg_be,
50 .len = sizeof(reg_be),
51 }, {
52 .addr = ts->client->addr,
53 .flags = I2C_M_RD,
54 .buf = (unsigned char *)buffer,
55 .len = sizeof(reg_be),
56 },
57 };
58 int ret, error;
59 int retry = IST3038C_I2C_RETRY_COUNT;
60
61 /* Retry in case the controller fails to respond */
62 do {
63 ret = i2c_transfer(ts->client->adapter, msg, ARRAY_SIZE(msg));
64 if (ret == ARRAY_SIZE(msg)) {
> 65 *buffer = be32_to_cpu(*buffer);
66 return 0;
67 }
68
69 error = ret < 0 ? ret : -EIO;
70 dev_err(&ts->client->dev,
71 "%s - i2c_transfer failed: %d (%d)\n",
72 __func__, error, ret);
73 } while (--retry);
74
75 return error;
76 }
77

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