Re: [PATCH 0/2] power: supply: sbs-battery: Fix the shared serial number buffer

Sebastian Reichel <[email protected]>
Newsgroups org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Sun, 26 Jul 2026 07:22:04 +0000, Babanpreet Singh wrote:
> The serial number of every sbs-battery instance is formatted into one
> file-scope buffer, so concurrent reads on two batteries can make one
> battery report the other's serial number. Patch 1 gives each device its
> own buffer.
> 
> While rewriting that sprintf() call it became apparent that the
> conversion is also the only W=1 warning in this driver: the value is
> carried in an int and only its negative half is rejected, so gcc cannot
> prove that four hex digits fit the five-byte buffer. Patch 2 casts to
> the register's actual width. It is a separate patch because it is a
> distinct (and purely cosmetic) change - please just drop it if you would
> rather not carry it.
> 
> [...]

Applied, thanks!

[1/2] power: supply: sbs-battery: Use a per-device serial number buffer
      commit: 6027892925b8d19d2245c2d077e2ae35b49cc2b1
[2/2] power: supply: sbs-battery: Bound the serial number conversion to 16 bits
      commit: 645448becbd0b52216c6741897dd412f9ff1b925

Best regards,
-- 
Sebastian Reichel <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.