Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601493 > unrolled thread

[PATCH] netxen_nic: remove redundant check if retries is zero

Started byColin King <colin.king@canonical.com>
First post2017-03-15 16:40 +0100
Last post2017-03-15 23:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netxen_nic: remove redundant check if retries is zero Colin King <colin.king@canonical.com> - 2017-03-15 16:40 +0100
    Re: [PATCH] netxen_nic: remove redundant check if retries is zero David Miller <davem@davemloft.net> - 2017-03-15 23:10 +0100

#1601493 — [PATCH] netxen_nic: remove redundant check if retries is zero

FromColin King <colin.king@canonical.com>
Date2017-03-15 16:40 +0100
Subject[PATCH] netxen_nic: remove redundant check if retries is zero
Message-ID<tljbP-16B-3@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 7b43a3b..3dd9734 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -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)
-- 
2.10.2

[toc] | [next] | [standalone]


#1601777

FromDavid Miller <davem@davemloft.net>
Date2017-03-15 23:10 +0100
Message-ID<tlphg-5w5-19@gated-at.bofh.it>
In reply to#1601493
From: Colin King <colin.king@canonical.com>
Date: Wed, 15 Mar 2017 15:31:58 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web