]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin()
authorJaroslav Kysela <perex@perex.cz>
Wed, 21 Sep 2022 09:33:22 +0000 (11:33 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 21 Sep 2022 10:11:41 +0000 (12:11 +0200)
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>
sound/pci/hda/patch_hdmi.c

index 1eb894e6cdf1b1bcaad1e92d059f326aca4c057b..11c22dfced068452f9af291791834792890cc05d 100644 (file)
@@ -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))