lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a5517624-6e26-497a-bcc7-84d7dd786d5c@wanadoo.fr>
Date: Tue, 8 Oct 2024 07:24:03 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Zhu Jun <zhujun2@...s.chinamobile.com>, perex@...ex.cz
Cc: tiwai@...e.com, k.kosik@...look.com, xristos.thes@...il.com,
 wangdicheng@...inos.cn, kl@...wtf, linux-sound@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Sound:mixer:Remove unnecessary assignment of sprintf
 result in build_mixer_unit_ctl

Le 08/10/2024 à 05:30, Zhu Jun a écrit :
> Simplified code by removing redundant assignment of sprintf return value
> 
> Signed-off-by: Zhu Jun <zhujun2@...s.chinamobile.com>
> ---
>   sound/usb/mixer.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 9945ae55b0d0..dea6cbd65667 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -2224,7 +2224,8 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
>   		len = get_term_name(state->chip, iterm, kctl->id.name,
>   				    sizeof(kctl->id.name), 0);
>   	if (!len)
> -		len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1);
> +		sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1);
> +
>   	append_ctl_name(kctl, " Volume");
>   
>   	usb_audio_dbg(state->chip, "[%d] MU [%s] ch = %d, val = %d/%d\n",

Hi,

even if not needed, using snprintf() with the same sizeof() as in 
append_ctl_name() would be nice, IMHO.

CJ


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ