diff mbox series

[net-next] net: tg3: fix obsolete check of !err

Message ID 20211006064120.25585-1-sakiwit@gmail.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: tg3: fix obsolete check of !err | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Jεan Sacren Oct. 6, 2021, 6:41 a.m. UTC
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 mbox series

Patch

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;