All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: tiwai@suse.com, perex@perex.cz, arnd@arndb.de,
	masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	alsa-devel@alsa-project.org, maciej.szmigiero@oracle.com
Subject: Re: [PATCH] ALSA: usb-audio: mixer: Remove temporary string use in parse_clock_source_unit
Date: Wed, 13 Sep 2023 12:21:46 +0200	[thread overview]
Message-ID: <87cyym4blx.wl-tiwai@suse.de> (raw)
In-Reply-To: <20230913093933.24564-1-peter.ujfalusi@linux.intel.com>

On Wed, 13 Sep 2023 11:39:33 +0200,
Peter Ujfalusi wrote:
> 
> The kctl->id.name can be directly passed to snd_usb_copy_string_desc() and
> if the string has been fetched the suffix can be appended with the
> append_ctl_name() call.
> The temporary name string becomes redundant and can be removed.
> 
> This change will also fixes the following compiler warning/error (W=1):
> 
> sound/usb/mixer.c: In function ‘parse_audio_unit’:
> sound/usb/mixer.c:1972:29: error: ‘ Validity’ directive output may be truncated writing 9 bytes into a region of size between 1 and 44 [-Werror=format-truncation=]
>  1972 |                          "%s Validity", name);
>       |                             ^~~~~~~~~
> In function ‘parse_clock_source_unit’,
>     inlined from ‘parse_audio_unit’ at sound/usb/mixer.c:2892:10:
> sound/usb/mixer.c:1971:17: note: ‘snprintf’ output between 10 and 53 bytes into a destination of size 44
>  1971 |                 snprintf(kctl->id.name, sizeof(kctl->id.name),
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1972 |                          "%s Validity", name);
>       |                          ~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> The warnings got brought to light by a recent patch upstream:
> commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1")
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

Thanks, applied now.


Takashi

      reply	other threads:[~2023-09-13 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  9:39 [PATCH] ALSA: usb-audio: mixer: Remove temporary string use in parse_clock_source_unit Peter Ujfalusi
2023-09-13 10:21 ` 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=87cyym4blx.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=masahiroy@kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.