All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin()
@ 2022-09-21  9:33 Jaroslav Kysela
  2022-09-21 10:11 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Jaroslav Kysela @ 2022-09-21  9:33 UTC (permalink / raw)
  To: ALSA development; +Cc: Takashi Iwai

Make the code more readable.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 sound/pci/hda/patch_hdmi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index dc36af2928b7..e20e0ed759f6 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1461,10 +1461,9 @@ static void hdmi_pcm_setup_pin(struct hdmi_spec *spec,
 	int mux_idx;
 	bool non_pcm;
 
-	if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used)
-		pcm = get_pcm_rec(spec, per_pin->pcm_idx);
-	else
+	if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used)
 		return;
+	pcm = get_pcm_rec(spec, per_pin->pcm_idx);
 	if (!pcm->pcm)
 		return;
 	if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use))
-- 
2.35.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin()
  2022-09-21  9:33 [PATCH] ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() Jaroslav Kysela
@ 2022-09-21 10:11 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2022-09-21 10:11 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: ALSA development

On Wed, 21 Sep 2022 11:33:22 +0200,
Jaroslav Kysela wrote:
> 
> Make the code more readable.
> 
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-21 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-21  9:33 [PATCH] ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() Jaroslav Kysela
2022-09-21 10:11 ` Takashi Iwai

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.