All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: hanzhijian <hanzhijian1991@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus/ibm-cffps) fix format-truncation warning
Date: Fri, 21 Aug 2026 12:05:04 +0000	[thread overview]
Message-ID: <20260821120504.CA3921F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821115703.2017414-1-hanzhijian1991@gmail.com>

> snprintf() with "%02X" and "%04X" specifiers on an int argument
> triggers -Wformat-truncation (and thus a build failure with
> CONFIG_WERROR) because GCC assumes the int can hold a value wider
> than the destination buffer.
> 
> The value comes from i2c_smbus_read_byte_data() and
> i2c_smbus_read_word_data(), which return at most 8 and 16 bits
> respectively, so mask the value to make that explicit and silence
> the warning.
> 
> Signed-off-by: hanzhijian <hanzhijian1991@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821115703.2017414-1-hanzhijian1991@gmail.com?part=1


  reply	other threads:[~2026-08-21 12:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 11:57 [PATCH] hwmon: (pmbus/ibm-cffps) fix format-truncation warning hanzhijian
2026-08-21 12:05 ` sashiko-bot [this message]
2026-08-21 13:59 ` Guenter Roeck
2026-08-21 14:04   ` hanzhijian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260821120504.CA3921F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hanzhijian1991@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.