aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/sof_sdw.c
diff options
context:
space:
mode:
authorGravatar Charles Keepax <ckeepax@opensource.cirrus.com> 2023-07-31 16:42:47 -0500
committerGravatar Mark Brown <broonie@kernel.org> 2023-07-31 23:22:33 +0100
commit31a54f78ad1d294432d63e9f72db08dc14cca432 (patch)
treef2f7d2758676bfc2c54d701b09a2026a4111b9e0 /sound/soc/intel/boards/sof_sdw.c
parentASoC: intel: sof_sdw: Use a module device table (diff)
downloadlinux-31a54f78ad1d294432d63e9f72db08dc14cca432.tar.gz
linux-31a54f78ad1d294432d63e9f72db08dc14cca432.tar.bz2
linux-31a54f78ad1d294432d63e9f72db08dc14cca432.zip
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>
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw.c')
-rw-r--r--sound/soc/intel/boards/sof_sdw.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 6b55bcdccccc..d3222f40d798 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -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 (i == ARRAY_SIZE(codec_info_list))
- return -EINVAL;
+ if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN))
+ return i;
- return i;
+ return -EINVAL;
}
/*