Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH] regmap-i2c: fix sparse warning in regmap_smbus_word_write_reg16
       [not found] <20260519170836.1344260-1-nissampa@cisco.com>
@ 2026-05-19 21:43 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-19 21:43 UTC (permalink / raw)
  To: Nishanth Sampath Kumar, broonie
  Cc: llvm, oe-kbuild-all, lkp, linux-kernel, nissampa

Hi Nishanth,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-regmap/for-next]
[also build test ERROR on linus/master v7.1-rc4 next-20260519]
[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/Nishanth-Sampath-Kumar/regmap-i2c-fix-sparse-warning-in-regmap_smbus_word_write_reg16/20260520-011137
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
patch link:    https://lore.kernel.org/r/20260519170836.1344260-1-nissampa%40cisco.com
patch subject: [PATCH] regmap-i2c: fix sparse warning in regmap_smbus_word_write_reg16
config: arm64-randconfig-004-20260520 (https://download.01.org/0day-ci/archive/20260520/202605200528.vTiSwokq-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260520/202605200528.vTiSwokq-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605200528.vTiSwokq-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/base/regmap/regmap-i2c.c:340:33: error: expected ';' after return statement
                                            ((u16)val << 8) | addr_lo));
                                                                      ^
                                                                      ;
   1 error generated.


vim +340 drivers/base/regmap/regmap-i2c.c

   305	
   306	/*
   307	 * SMBus byte/word reg16 support for adapters that have SMBUS_BYTE_DATA
   308	 * and SMBUS_WORD_DATA but lack I2C_FUNC_I2C and I2C_FUNC_SMBUS_I2C_BLOCK,
   309	 * such as the AMD PIIX4.
   310	 *
   311	 * READ:  set 16-bit EEPROM address via write_byte_data(addr_lo, addr_hi),
   312	 *        then sequentially read bytes via read_byte() (EEPROM auto-
   313	 *        increments the address pointer).  Same as the I2C-block reg16
   314	 *        read path above.
   315	 *
   316	 * WRITE: encode the low address byte and data into a word transaction:
   317	 *        write_word_data(addr_hi, (data_byte << 8) | addr_lo).
   318	 *        Only single-byte writes are supported (one value per transaction).
   319	 */
   320	static int regmap_smbus_word_write_reg16(void *context, const void *data,
   321						 size_t count)
   322	{
   323		struct device *dev = context;
   324		struct i2c_client *i2c = to_i2c_client(dev);
   325		u8 addr_hi, addr_lo, val;
   326	
   327		/*
   328		 * data layout: [addr_hi, addr_lo, val0, val1, ...].
   329		 * Only single-byte value writes are supported; multi-byte would
   330		 * require raw I2C (or repeated word writes with incrementing address).
   331		 */
   332		if (count != 3)
   333			return -EINVAL;
   334	
   335		addr_hi = ((u8 *)data)[0];
   336		addr_lo = ((u8 *)data)[1];
   337		val = ((u8 *)data)[2];
   338	
   339		return i2c_smbus_write_word_data(i2c, addr_hi,
 > 340						 ((u16)val << 8) | addr_lo));
   341	}
   342	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-19 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260519170836.1344260-1-nissampa@cisco.com>
2026-05-19 21:43 ` [PATCH] regmap-i2c: fix sparse warning in regmap_smbus_word_write_reg16 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox