qlge: Move jiffies_to_usecs immediately before loop
authorJoe Perches <joe@perches.com>
Wed, 20 May 2015 04:44:52 +0000 (21:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 May 2015 21:23:18 +0000 (17:23 -0400)
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>
drivers/net/ethernet/qlogic/qlge/qlge_main.c

index 25800a1dedcb9fbe0635e80386521dc789575fba..02b7115b6aaa64add8632094f6f0dfe354a89b7d 100644 (file)
@@ -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.
         */
@@ -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)