netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jεan Sacren" <sakiwit@gmail.com>
To: Siva Reddy Kallam <siva.kallam@broadcom.com>
Cc: prashant@broadcom.com, mchan@broadcom.com, davem@davemloft.net,
	kuba@kernel.org, netdev@vger.kernel.org
Subject: [PATCH net-next] net: tg3: fix obsolete check of !err
Date: Wed,  6 Oct 2021 00:41:20 -0600	[thread overview]
Message-ID: <20211006064120.25585-1-sakiwit@gmail.com> (raw)

From: Jean Sacren <sakiwit@gmail.com>

The err variable is checked for true or false a few lines above.  When
!err is checked again, it always evaluates to true.  Therefore we should
skip this check.

We should also group the adjacent statements together for readability.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index d95b11480865..5a50ea75094f 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -11202,34 +11202,30 @@ static void tg3_reset_task(struct work_struct *work)
 	err = tg3_init_hw(tp, true);
 	if (err) {
 		tg3_full_unlock(tp);
 		tp->irq_sync = 0;
 		tg3_napi_enable(tp);
 		/* Clear this flag so that tg3_reset_task_cancel() will not
 		 * call cancel_work_sync() and wait forever.
 		 */
 		tg3_flag_clear(tp, RESET_TASK_PENDING);
 		dev_close(tp->dev);
 		goto out;
 	}
 
 	tg3_netif_start(tp);
-
 	tg3_full_unlock(tp);
-
-	if (!err)
-		tg3_phy_start(tp);
-
+	tg3_phy_start(tp);
 	tg3_flag_clear(tp, RESET_TASK_PENDING);
 out:
 	rtnl_unlock();
 }
 
 static int tg3_request_irq(struct tg3 *tp, int irq_num)
 {
 	irq_handler_t fn;
 	unsigned long flags;
 	char *name;
 	struct tg3_napi *tnapi = &tp->napi[irq_num];
 
 	if (tp->irq_cnt == 1)
 		name = tp->dev->name;

                 reply	other threads:[~2021-10-06  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211006064120.25585-1-sakiwit@gmail.com \
    --to=sakiwit@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.com \
    --cc=siva.kallam@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).