Re: [PATCH] regmap-i2c: fix sparse warning in regmap_smbus_word_write_reg16

From: Mark Brown

Date: Tue May 19 2026 - 12:56:28 EST


On Tue, May 19, 2026 at 04:52:05PM +0000, Nishanth Sampath Kumar wrote:
> From 12085a8445d18202a59e3558118f74db32673b17 Mon Sep 17 00:00:00 2001
> From: Nishanth Sampath Kumar <nissampa@xxxxxxxxx>
> Date: Tue, 19 May 2026 09:41:53 -0700
> Subject: [PATCH] regmap-i2c: fix sparse warning in
> regmap_smbus_word_write_reg16

Please post the patch as covered in submitting-patches.rst, not as an
attachment. If you're having trouble with your mail server b4 send is
helpful:

https://b4.docs.kernel.org/en/latest/contributor/overview.html

> return i2c_smbus_write_word_data(i2c, addr_hi,
> - cpu_to_le16(((u16)val << 8) | addr_lo));
> + (u16)(((u16)val << 8) | addr_lo));

What is the top level (u16) cast doing here? This is not a legibility
triumph...

Attachment: signature.asc
Description: PGP signature