aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <[email protected]>2020-06-09 04:54:34 +0800
committerVinod Koul <[email protected]>2020-06-30 21:26:17 +0530
commitee9173db5037cf46aba47161043ec6f0e06cf9d3 (patch)
treea330b2611d3e610ca3d3961c0ec0704c8a7994a2
parente3f88cdb8fdd5876ef3a0373e35ba7f2598fcf17 (diff)
soundwire: bus_type: convert open-coded while() to for() loop
No functionality change, just more structured code. Suggested-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
-rw-r--r--drivers/soundwire/bus_type.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c
index de9a671802b8..c8d948c09d9d 100644
--- a/drivers/soundwire/bus_type.c
+++ b/drivers/soundwire/bus_type.c
@@ -20,14 +20,12 @@
static const struct sdw_device_id *
sdw_get_device_id(struct sdw_slave *slave, struct sdw_driver *drv)
{
- const struct sdw_device_id *id = drv->id_table;
+ const struct sdw_device_id *id;
- while (id && id->mfg_id) {
+ for (id = drv->id_table; id && id->mfg_id; id++)
if (slave->id.mfg_id == id->mfg_id &&
slave->id.part_id == id->part_id)
return id;
- id++;
- }
return NULL;
}