From: Jaroslav Kysela Date: Wed, 21 Sep 2022 09:33:22 +0000 (+0200) Subject: ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() X-Git-Tag: v6.1~436^2~1^2~28 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9bf320f0cf872bf23d9f03abefeff2130acbd6c5;p=mirror_ubuntu-kernels.git ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() Make the code more readable. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220921093322.82609-1-perex@perex.cz Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 1eb894e6cdf1..11c22dfced06 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1472,10 +1472,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))