netxen_nic: remove redundant check if retries is zero
authorColin Ian King <colin.king@canonical.com>
Wed, 15 Mar 2017 15:31:58 +0000 (15:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Mar 2017 22:04:08 +0000 (15:04 -0700)
At the end of the timeout loop, retries will always be zero so
the check for zero is redundant so remove it.  Also replace
printk with pr_err as recommended by checkpatch.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c

index 7b43a3b4abdcbc7bc1cdfd4d13c611563e2760a2..3dd973475125c0f856d4eccacba4ce4c0c34cc50 100644 (file)
@@ -1375,13 +1375,8 @@ netxen_receive_peg_ready(struct netxen_adapter *adapter)
 
        } while (--retries);
 
-       if (!retries) {
-               printk(KERN_ERR "Receive Peg initialization not "
-                             "complete, state: 0x%x.\n", val);
-               return -EIO;
-       }
-
-       return 0;
+       pr_err("Receive Peg initialization not complete, state: 0x%x.\n", val);
+       return -EIO;
 }
 
 int netxen_init_firmware(struct netxen_adapter *adapter)