summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2022-09-21 11:33:22 +0200
committerTakashi Iwai <tiwai@suse.de>2022-09-21 12:11:41 +0200
commit9bf320f0cf872bf23d9f03abefeff2130acbd6c5 (patch)
treeea92a345dc82cef6e61a967365500185498ed9c0 /sound/pci/hda/patch_hdmi.c
parentALSA: usb-audio: Properly refcounting clock rate (diff)
downloadlinux-9bf320f0cf872bf23d9f03abefeff2130acbd6c5.tar.xz
linux-9bf320f0cf872bf23d9f03abefeff2130acbd6c5.zip
ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin()
Make the code more readable. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20220921093322.82609-1-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c5
1 files changed, 2 insertions, 3 deletions
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))