From: Stephen Boyd <sboyd@kernel.org>
To: Marek Vasut <marex@denx.de>, linux-clk@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>, kernel test robot <lkp@intel.com>,
Michael Turquette <mturquette@baylibre.com>
Subject: Re: [PATCH] clk: si521xx: Increase stack based print buffer size in probe
Date: Fri, 27 Oct 2023 12:20:39 -0700 [thread overview]
Message-ID: <6c2f97c17fdab82782ccc0a09c291d4b.sboyd@kernel.org> (raw)
In-Reply-To: <20231027085840.30098-1-marex@denx.de>
Quoting Marek Vasut (2023-10-27 01:58:24)
> Increase the size of temporary print buffer on stack to fix the
> following warnings reported by LKP.
>
> Since all the input parameters of snprintf() are under control
> of this driver, it is not possible to trigger and overflow here,
> but since the print buffer is on stack and discarded once driver
> probe() finishes, it is not an issue to increase it by 10 bytes
> and fix the warning in the process. Make it so.
>
> "
> drivers/clk/clk-si521xx.c: In function 'si521xx_probe':
> >> drivers/clk/clk-si521xx.c:318:26: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
> snprintf(name, 6, "DIFF%d", i);
> ^~
> drivers/clk/clk-si521xx.c:318:21: note: directive argument in the range [0, 2147483647]
> snprintf(name, 6, "DIFF%d", i);
> ^~~~~~~~
> drivers/clk/clk-si521xx.c:318:3: note: 'snprintf' output between 6 and 15 bytes into a destination of size 6
> snprintf(name, 6, "DIFF%d", i);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "
>
> Fixes: edc12763a3a2 ("clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202310260412.AGASjFN4-lkp@intel.com/
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
Applied to clk-next
prev parent reply other threads:[~2023-10-27 19:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 8:58 [PATCH] clk: si521xx: Increase stack based print buffer size in probe Marek Vasut
2023-10-27 19:20 ` Stephen Boyd [this message]
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=6c2f97c17fdab82782ccc0a09c291d4b.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marex@denx.de \
--cc=mturquette@baylibre.com \
/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