From: Marek Vasut <marek.vasut@mailbox.org>
To: kernel test robot <lkp@intel.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Stephen Boyd <sboyd@kernel.org>
Subject: Re: drivers/clk/clk-renesas-pcie.c:178:31: warning: '%d' directive output may be truncated writing between 1 and 4 bytes into a region of size 2
Date: Mon, 20 Jan 2025 08:19:20 +0100 [thread overview]
Message-ID: <55f6f8ec-48bf-4d0e-ab74-b5bc7c9a7f56@mailbox.org> (raw)
In-Reply-To: <202501200756.HycDH8wZ-lkp@intel.com>
On 1/20/25 12:45 AM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 9528d418de4d83c7ada69314ddd8d4427b1f703a
> commit: cd9a5c97dfdaeb9c8ac02e14d7ccbd445e8b5265 clk: rs9: Replace model check with bitshift from chip data
> date: 1 year, 1 month ago
> config: s390-randconfig-r111-20250120 (https://download.01.org/0day-ci/archive/20250120/202501200756.HycDH8wZ-lkp@intel.com/config)
> compiler: s390-linux-gcc (GCC) 14.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20250120/202501200756.HycDH8wZ-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/202501200756.HycDH8wZ-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> drivers/clk/clk-renesas-pcie.c: In function 'rs9_probe':
>>> drivers/clk/clk-renesas-pcie.c:178:31: warning: '%d' directive output may be truncated writing between 1 and 4 bytes into a region of size 2 [-Wformat-truncation=]
> 178 | snprintf(name, 5, "DIF%d", idx);
> | ^~
> In function 'rs9_get_output_config',
> inlined from 'rs9_probe' at drivers/clk/clk-renesas-pcie.c:305:9:
> drivers/clk/clk-renesas-pcie.c:178:27: note: directive argument in the range [-250, 63]
> 178 | snprintf(name, 5, "DIF%d", idx);
> | ^~~~~~~
> drivers/clk/clk-renesas-pcie.c:178:9: note: 'snprintf' output between 5 and 8 bytes into a destination of size 5
> 178 | snprintf(name, 5, "DIF%d", idx);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
I can extend the name variable to length 8 to mitigate this warning, but
there is some 8 DIF outputs maximum on this hardware, so it is known
this %d field would not be longer than 1 decimal number. Shall I send
such a patch ?
next prev parent reply other threads:[~2025-01-20 7:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-19 23:45 kernel test robot
2025-01-20 7:19 ` Marek Vasut [this message]
2025-01-20 8:41 ` Geert Uytterhoeven
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=55f6f8ec-48bf-4d0e-ab74-b5bc7c9a7f56@mailbox.org \
--to=marek.vasut@mailbox.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sboyd@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®