Hi Aman, kernel test robot noticed the following build warnings: [auto build test WARNING on robh/for-next] [also build test WARNING on linus/master v6.14-rc2 next-20250213] [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/Aman-Kumar-Pandey/drivers-i3c-Add-driver-for-NXP-P3H2x4x-i3c-hub-device/20250212-213659 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20250212132227.1348374-2-aman.kumarpandey%40nxp.com patch subject: [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-lkp@xxxxxxxxx/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-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/202502131947.VmPYnXuz-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:6: In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub.h:12: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:181: In file included from arch/s390/include/asm/mmu_context.h:11: In file included from arch/s390/include/asm/pgalloc.h:18: In file included from include/linux/mm.h:2224: include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 505 | item]; | ~~~~ include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 512 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 525 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ >> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:7: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 52 | if (ret) | ^~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here 80 | regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear); | ^~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:3: note: remove the 'if' if its condition is always false 52 | if (ret) | ^~~~~~~~ 53 | goto ibi_err; | ~~~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 45 | if (ret) | ^~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here 80 | regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear); | ^~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:2: note: remove the 'if' if its condition is always false 45 | if (ret) | ^~~~~~~~ 46 | goto ibi_err; | ~~~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 32 | if (ret) | ^~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here 80 | regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear); | ^~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:2: note: remove the 'if' if its condition is always false 32 | if (ret) | ^~~~~~~~ 33 | goto ibi_err; | ~~~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 27 | if (ret) | ^~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here 80 | regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear); | ^~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:2: note: remove the 'if' if its condition is always false 27 | if (ret) | ^~~~~~~~ 28 | goto ibi_err; | ~~~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:20:35: note: initialize the variable 'flag_clear' to silence this warning 20 | u8 target_buffer_page, flag_clear, rx_data, temp, i; | ^ | = '\0' >> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'write_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] 453 | default: | ^~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:460:12: note: uninitialized use occurs here 460 | desc[2] = write_length; | ^~~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:30: note: initialize the variable 'write_length' to silence this warning 372 | u8 read_length, write_length; | ^ | = '\0' >> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'read_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] 453 | default: | ^~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:461:12: note: uninitialized use occurs here 461 | desc[3] = read_length; | ^~~~~~~~~~~ drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:16: note: initialize the variable 'read_length' to silence this warning 372 | u8 read_length, write_length; | ^ | = '\0' 9 warnings generated. vim +52 drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c 12 13 static void p3h2x4x_read_smbus_agent_rx_buf(struct i3c_device *i3cdev, enum p3h2x4x_rcv_buf rfbuf, 14 enum p3h2x4x_tp tp, bool is_of) 15 { 16 struct device *dev = i3cdev_to_dev(i3cdev); 17 struct p3h2x4x *priv = dev_get_drvdata(dev); 18 struct smbus_device *backend = NULL; 19 20 u8 target_buffer_page, flag_clear, rx_data, temp, i; 21 u8 slave_rx_buffer[P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE] = { 0 }; 22 u32 packet_len, slave_address, ret; 23 24 target_buffer_page = (((rfbuf) ? P3H2x4x_TARGET_BUFF_1_PAGE : P3H2x4x_TARGET_BUFF_0_PAGE) 25 + (P3H2x4x_NO_PAGE_PER_TP * tp)); 26 ret = regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, target_buffer_page); 27 if (ret) 28 goto ibi_err; 29 30 /* read buffer length */ 31 ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_LENGTH, &packet_len); 32 if (ret) 33 goto ibi_err; 34 35 if (packet_len) 36 packet_len = packet_len - 1; 37 38 if (packet_len > P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE) { 39 dev_err(dev, "Received message too big for p3h2x4x buffer\n"); 40 return; 41 } 42 43 /* read slave address */ 44 ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_ADDRESS, &slave_address); 45 if (ret) 46 goto ibi_err; 47 48 /* read data */ 49 if (packet_len) { 50 ret = regmap_bulk_read(priv->regmap, P3H2x4x_TARGET_BUFF_DATA, 51 slave_rx_buffer, packet_len); > 52 if (ret) 53 goto ibi_err; 54 } 55 56 if (is_of) 57 flag_clear = BUF_RECEIVED_FLAG_TF_MASK; 58 else 59 flag_clear = (((rfbuf == RCV_BUF_0) ? P3H2x4x_TARGET_BUF_0_RECEIVE : 60 P3H2x4x_TARGET_BUF_1_RECEIVE)); 61 62 /* notify slave driver about received data */ 63 list_for_each_entry(backend, &priv->tp_bus[tp].tp_device_entry, list) { 64 if ((slave_address >> 1 == backend->addr) && (priv->is_slave_reg)) { 65 i2c_slave_event(backend->client, I2C_SLAVE_WRITE_REQUESTED, 66 (u8 *)&slave_address); 67 68 for (i = 0; i < packet_len; i++) { 69 rx_data = slave_rx_buffer[i]; 70 i2c_slave_event(backend->client, I2C_SLAVE_WRITE_RECEIVED, 71 &rx_data); 72 } 73 i2c_slave_event(backend->client, I2C_SLAVE_STOP, &temp); 74 break; 75 } 76 } 77 78 ibi_err: 79 regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, 0x00); 80 regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear); 81 } 82 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki