Re: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA

From: kernel test robot
Date: Sat Nov 25 2023 - 04:13:09 EST


Hi Anshul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.7-rc2 next-20231124]
[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/Anshul-Dalal/dt-bindings-iio-chemical-add-aosong-ags02ma/20231121-180435
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20231121095800.2180870-3-anshulusr%40gmail.com
patch subject: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
config: arm-randconfig-r081-20231123 (https://download.01.org/0day-ci/archive/20231125/202311251636.m0yt3fIb-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231125/202311251636.m0yt3fIb-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311251636.m0yt3fIb-lkp@xxxxxxxxx/

New smatch warnings:
drivers/iio/chemical/ags02ma.c:53 ags02ma_register_read() warn: unsigned 'ret' is never less than zero.

Old smatch warnings:
drivers/iio/chemical/ags02ma.c:63 ags02ma_register_read() warn: unsigned 'ret' is never less than zero.

vim +/ret +53 drivers/iio/chemical/ags02ma.c

45
46 static u32 ags02ma_register_read(struct i2c_client *client, u8 reg, u16 delay)
47 {
48 u32 ret;
49 u8 crc;
50 struct ags02ma_reading read_buffer;
51
52 ret = i2c_master_send(client, &reg, sizeof(reg));
> 53 if (ret < 0) {
54 dev_err(&client->dev,
55 "Failed to send data to register 0x%x: %d", reg, ret);
56 return ret;
57 }
58
59 /* Processing Delay, Check Table 7.7 in the datasheet */
60 msleep_interruptible(delay);
61
62 ret = i2c_master_recv(client, (u8 *)&read_buffer, sizeof(read_buffer));
63 if (ret < 0) {
64 dev_err(&client->dev,
65 "Failed to receive from register 0x%x: %d", reg, ret);
66 return ret;
67 }
68 ret = be32_to_cpu(read_buffer.data);
69
70 crc = crc8(ags02ma_crc8_table, (u8 *)&read_buffer.data,
71 sizeof(read_buffer.data), AGS02MA_CRC8_INIT);
72 if (crc != read_buffer.crc) {
73 dev_err(&client->dev, "CRC error\n");
74 return -EIO;
75 }
76
77 return ret;
78 }
79

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki