From: Dan Carpenter <error27@gmail.com>
To: Garrett Floyd <garrettfloyd345@hotmail.com>
Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>,
Mark Greer <mgreer@animalcreek.com>,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: audio: add size enforcement to name prefix in topology
Date: Wed, 18 Nov 2026 12:00:20 +0300 [thread overview]
Message-ID: <av1pJIssLeNxZiIS@stanley.mountain> (raw)
In-Reply-To: <DS4PPF67BA2A7859950C09372FE7397AAAFE67A2@DS4PPF67BA2A785.NAMP223.PROD.OUTLOOK.COM>
On Tue, Nov 17, 2026 at 08:44:33PM -0700, Garrett Floyd wrote:
> Copied name for certain functions can be 32 bytes, but destination is
> also only 32 bytes. After adding prefix, name may be truncated, causing
> compiler warning from -Wformat-truncation.
>
> drivers/staging/greybus/audio_topology.c: In function ‘gbaudio_tplg_process_kcontrols’:
> drivers/staging/greybus/audio_topology.c:1172:65: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size between 17 and 27 [-Wformat-truncation=]
> drivers/staging/greybus/audio_topology.c: In function ‘gbaudio_tplg_create_widget’:
> drivers/staging/greybus/audio_topology.c:1090:51: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size between 17 and 27 [-Wformat-truncation=]
Just ignore this warning. It's stupid.
We're using snprintf() as a belt and suspenders approach to preventing
buffer overflows. If it gets truncated that's fine. Great even.
The fix is to disable stupid warnings from W=1.
regards,
dan carpenter
prev parent reply other threads:[~2026-11-18 9:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 3:44 Garrett Floyd
2026-11-18 9:00 ` Dan Carpenter [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=av1pJIssLeNxZiIS@stanley.mountain \
--to=error27@gmail.com \
--cc=elder@kernel.org \
--cc=garrettfloyd345@hotmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mgreer@animalcreek.com \
--cc=vaibhav.sr@gmail.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
all inboxes | Powered by JetHome®