Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlge: Move jiffies_to_usecs immediately before loop

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>

authored by

Joe Perches and committed by
David S. Miller
3f6e785f 4ac2dc89

+1 -3
+1 -3
drivers/net/ethernet/qlogic/qlge/qlge_main.c
··· 3871 3871 return status; 3872 3872 } 3873 3873 3874 - end_jiffies = jiffies + 3875 - max((unsigned long)1, usecs_to_jiffies(30)); 3876 - 3877 3874 /* Check if bit is set then skip the mailbox command and 3878 3875 * clear the bit, else we are in normal reset process. 3879 3876 */ ··· 3885 3888 3886 3889 ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); 3887 3890 3891 + end_jiffies = jiffies + usecs_to_jiffies(30); 3888 3892 do { 3889 3893 value = ql_read32(qdev, RST_FO); 3890 3894 if ((value & RST_FO_FR) == 0)