mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Aibing Chen <chenaibing@cmss.chinamobile.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: aoa: size the codec reference property name buffer
Date: Mon, 16 Nov 2026 12:31:22 +0100	[thread overview]
Message-ID: <87cxs5ypv9.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261113103006.705-1-chenaibing@cmss.chinamobile.com>

On Fri, 13 Nov 2026 11:30:06 +0100,
Aibing Chen wrote:
> 
> check_codec() builds the device tree property name
> "platform-<codec>-codec-ref" in a 32 byte buffer with snprintf().
> A codec name may be up to MAX_CODEC_NAME_LEN - 1 (31) characters and
> the surrounding text adds 19 characters, so the full name can be 50
> characters plus the terminator.  Codec names longer than 12 characters
> are silently truncated, of_get_property() then looks up a property name
> that does not exist, and check_codec() fails the codec with "required
> property ... not present".
> 
> All codecs in the tree use shorter names today, but the buffer should
> match the documented maximum.  Size it from MAX_CODEC_NAME_LEN, which
> is already available through "../aoa.h".
> 
> Compiling with W=1 before this change reports:
> 
>   sound/aoa/fabrics/layout.c:780:36: warning: '%s' directive output may be truncated writing up to 31 bytes into a region of size 23 [-Wformat-truncation=]
> 
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>

Is the string really truncated unexpectedly?

Otherwise it's just an incorrect compiler warning, and extending the
size doesn't make sense.


thanks,

Takashi

      reply	other threads:[~2026-11-16 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:30 Aibing Chen
2026-11-16 11:31 ` Takashi Iwai [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=87cxs5ypv9.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chenaibing@cmss.chinamobile.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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®