mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Eduard Zateev <hackerowskiy@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vaibhav Agarwal <vaibhav.sr@gmail.com>,
	Mark Greer <mgreer@animalcreek.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: avoid snprintf truncation in audio topology
Date: Wed, 23 Sep 2026 11:01:41 +0300	[thread overview]
Message-ID: <arOHZcAocfvxCJP3@stanley.mountain> (raw)
In-Reply-To: <20260923023405.41700-1-hackerowskiy@gmail.com>

On Wed, Sep 23, 2026 at 04:34:05AM +0200, Eduard Zateev wrote:
> Building with W=1 reports format truncation warnings when prefixing
> the Greybus device id to widget and control names.
> 
> The destination buffers are NAME_SIZE bytes, while the copied topology
> names may already take most of that space. Split the operation into
> writing the prefix first and then copying the remaining name into the
> space left in the destination buffer.
> 
> This avoids the -Wformat-truncation warnings while preserving bounded
> string handling.
> 
> Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
> ---

I hate the -Wformat-truncation warning.  It doesn't really matter for
the kernel.  Dmesg output has always been really grotty and especially
when you actually need it because of a crash then that's when it's
the most jumbled.  Truncating the last couple bytes is not going to
make a crash noticably more difficult to solve.

The fix is to get rid of -Wformat-truncation for kernel builds.

This patch silences the warning but doesn't fix anything and makes
the code less readable.

regards,
dan carpenter


      reply	other threads:[~2026-09-23  8:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  2:34 Eduard Zateev
2026-09-23  8:01 ` 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=arOHZcAocfvxCJP3@stanley.mountain \
    --to=error27@gmail.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=hackerowskiy@gmail.com \
    --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®