Skip to content

Commit

Permalink
staging: qlge: qlge_dbg: Simplify while statements
Browse files Browse the repository at this point in the history
Simplify while loops into more readable and simple for loops.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Link: https://lore.kernel.org/r/79e35c695a80168639c073137a80804da3362301.1594642213.git.usuraj35@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Suraj Upadhyay authored and Greg Kroah-Hartman committed Jul 13, 2020
1 parent dd7f1b6 commit 73b3044
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/staging/qlge/qlge_dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg,
u32 bit, u32 err_bit)
{
u32 temp;
int count = 10;
int count;

while (count) {
for (count = 10; count; count--) {
temp = ql_read_other_func_reg(qdev, reg);

/* check for errors */
Expand All @@ -53,7 +53,6 @@ static int ql_wait_other_func_reg_rdy(struct ql_adapter *qdev, u32 reg,
else if (temp & bit)
return 0;
mdelay(10);
count--;
}
return -1;
}
Expand Down

0 comments on commit 73b3044

Please sign in to comment.