mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
ASoC: intel: sof_sdw: Simplify find_codec_info_acpi
Use a return rather than a break and an additional range check. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230731214257.444605-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
18c45cb362
commit
31a54f78ad
@ -1003,14 +1003,10 @@ static inline int find_codec_info_acpi(const u8 *acpi_id)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
|
||||
if (!memcmp(codec_info_list[i].acpi_id, acpi_id,
|
||||
ACPI_ID_LEN))
|
||||
break;
|
||||
if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN))
|
||||
return i;
|
||||
|
||||
if (i == ARRAY_SIZE(codec_info_list))
|
||||
return -EINVAL;
|
||||
|
||||
return i;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user