Skip to content

Commit

Permalink
qlge: Move jiffies_to_usecs immediately before loop
Browse files Browse the repository at this point in the history
30 usecs (or really, 1 jiffy) can go by pretty fast.

Move the set of the timeout immediately before the loop.

Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
usecs_to_jiffies with a non-zero constant is guaranteed
to be non-zero.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed May 21, 2015
1 parent 4ac2dc8 commit 3f6e785
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/qlogic/qlge/qlge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
return status;
}

end_jiffies = jiffies +
max((unsigned long)1, usecs_to_jiffies(30));

/* Check if bit is set then skip the mailbox command and
* clear the bit, else we are in normal reset process.
*/
Expand All @@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev)

ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);

end_jiffies = jiffies + usecs_to_jiffies(30);
do {
value = ql_read32(qdev, RST_FO);
if ((value & RST_FO_FR) == 0)
Expand Down

0 comments on commit 3f6e785

Please sign in to comment.