summaryrefslogtreecommitdiffstats
path: root/sound/hda
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2022-10-19 18:21:14 +0200
committerTakashi Iwai <tiwai@suse.de>2022-10-20 14:31:42 +0200
commitf90025100fb50552a8281becd8f26aab065d4c31 (patch)
treefba3b9a54d9c350ac04f543add2b6897ad6c11bc /sound/hda
parentALSA: hda: ext: reduce ambiguity between 'multi-link' and 'link' DMA (diff)
downloadlinux-f90025100fb50552a8281becd8f26aab065d4c31.tar.xz
linux-f90025100fb50552a8281becd8f26aab065d4c31.zip
ALSA: hda: hdac_ext_controller: remove useless loop
commit 0b00a5615dc40 ("ALSA: hdac_ext: add hdac extended controller") introduced a for() loop on the number of HDaudio codecs that seems completely useless. a) the body of the loop does not make use of the loop index, and b) the LSDIID register is related to the SDI line, so there can only be one codec per multi-link descriptor. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221019162115.185917-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/ext/hdac_ext_controller.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
index 08d3313f2df7..6199bb60ccf0 100644
--- a/sound/hda/ext/hdac_ext_controller.c
+++ b/sound/hda/ext/hdac_ext_controller.c
@@ -135,12 +135,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_link_free_all);
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr)
{
struct hdac_ext_link *hlink;
- int i;
list_for_each_entry(hlink, &bus->hlink_list, list)
- for (i = 0; i < HDA_MAX_CODECS; i++)
- if (hlink->lsdiid & (0x1 << addr))
- return hlink;
+ if (hlink->lsdiid & (0x1 << addr))
+ return hlink;
return NULL;
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_hlink_by_addr);