Skip to content

Commit

Permalink
i2c: designware: Replace a while-loop by for-loop
Browse files Browse the repository at this point in the history
Replace a while-loop by for-loop in i2c_dw_probe_lock_support() to
save a few lines of code.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Andi Shyti committed Sep 9, 2024
1 parent 23cc961 commit 1a2b14e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/i2c/busses/i2c-designware-platdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,9 @@ static int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev)
int i = 0;
int ret;

ptr = i2c_dw_semaphore_cb_table;

dev->semaphore_idx = -1;

while (ptr->probe) {
for (ptr = i2c_dw_semaphore_cb_table; ptr->probe; ptr++) {
ret = ptr->probe(dev);
if (ret) {
/*
Expand All @@ -254,7 +252,6 @@ static int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev)
return ret;

i++;
ptr++;
continue;
}

Expand Down

0 comments on commit 1a2b14e

Please sign in to comment.