From: Dhruva Gole <d-gole@ti.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: <linux-pm@vger.kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
kernel test robot <lkp@intel.com>, <linux-kernel@vger.kernel.org>,
Dhruva Gole <d-gole@ti.com>
Subject: Re: [PATCH] OPP: debugfs: Fix warning with W=1 builds
Date: Mon, 4 Mar 2024 13:12:53 +0530 [thread overview]
Message-ID: <ae566a5d-b31c-4e69-8e79-92322ac7e104@ti.com> (raw)
In-Reply-To: <50a1a0f23efdc261844a306f5e611051843b4e52.1709536847.git.viresh.kumar@linaro.org>
Hi Viresh,
On 04/03/24 12:50, Viresh Kumar wrote:
> We currently get the following warning:
>
> debugfs.c:105:54: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
> snprintf(name, sizeof(name), "supply-%d", i);
> ^~
> debugfs.c:105:46: note: directive argument in the range [-2147483644, 2147483646]
> snprintf(name, sizeof(name), "supply-%d", i);
> ^~~~~~~~~~~
> debugfs.c:105:17: note: 'snprintf' output between 9 and 19 bytes into a destination of size 15
> snprintf(name, sizeof(name), "supply-%d", i);
>
> Fix this and another potential issue it by increasing size of the arrays.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202402141313.81ltVF5g-lkp@intel.com/
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/opp/debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c
> index ec030b19164a..96313aa55db6 100644
> --- a/drivers/opp/debugfs.c
> +++ b/drivers/opp/debugfs.c
> @@ -78,7 +78,7 @@ static void opp_debug_create_clks(struct dev_pm_opp *opp,
> struct opp_table *opp_table,
> struct dentry *pdentry)
> {
> - char name[12];
> + char name[19];
I'd rather we use malloc or else change the limits of the
"rate_hz_%d" to "rate_hz_%4d" or how many ever digits makes sense.
[...]
--
Thanks and Regards,
Dhruva Gole
next prev parent reply other threads:[~2024-03-04 7:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 7:20 Viresh Kumar
2024-03-04 7:42 ` Dhruva Gole [this message]
2024-03-04 10:58 ` Viresh Kumar
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=ae566a5d-b31c-4e69-8e79-92322ac7e104@ti.com \
--to=d-gole@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=nm@ti.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@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®