public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Rong Zhang <i@rong.moe>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Dan Carpenter <error27@gmail.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: Tidy up error check for processing unit
Date: Wed, 15 Apr 2026 14:28:21 +0200	[thread overview]
Message-ID: <87mrz4flwa.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260414-uac-build_auto_procunit-refactor-v1-1-afeb7efa6518@rong.moe>

On Tue, 14 Apr 2026 15:29:01 +0200,
Rong Zhang wrote:
> 
> There are two duplicated code paths calling get_min_max() with the same
> arguments in build_audio_procunit(). This once led to a failure to
> notice a code path that caused the `err' variable uninitialized when
> adding error checks for callers of get_min_max*() [1].
> 
> Move cases in the switch-case statement to tidy up the error check by
> merging the duplicated code paths together with a fallthrough attribute.
> This also eliminates the `err = 0' lines and aggregates the error check
> along with the corresponding call together, so that the intent of these
> code paths is clearer.
> 
> The refactor also has an interesting effect that shrinks the .text size
> by 16 bytes (GCC 15 amd64). It seems that the compiler was unable to
> perform dead code elimination for the `err = 0' paths before.
> 
> Link: https://lore.kernel.org/r/ad36dGpCBTGsyFr_@stanley.mountain/ [1]
> Signed-off-by: Rong Zhang <i@rong.moe>

Applied now.  Thanks.


Takashi

      reply	other threads:[~2026-04-15 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 13:29 [PATCH] ALSA: usb-audio: Tidy up error check for processing unit Rong Zhang
2026-04-15 12:28 ` 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=87mrz4flwa.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=error27@gmail.com \
    --cc=i@rong.moe \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.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