netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tg3: Remove residual error handling in tg3_suspend
@ 2024-03-07 19:23 Nikita Kiryushin
  2024-03-07 22:38 ` Michael Chan
  0 siblings, 1 reply; 12+ messages in thread
From: Nikita Kiryushin @ 2024-03-07 19:23 UTC (permalink / raw)
  To: Pavan Chebbi
  Cc: Michael Chan, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rafael J. Wysocki, netdev, linux-kernel, lvc-project


As of now, tg3_power_down_prepare always ends with success, but
the error handling code from former tg3_set_power_state call is still here.

Remove (now unreachable) code for simplification.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
---
  drivers/net/ethernet/broadcom/tg3.c | 26 ++------------------------
  1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c 
b/drivers/net/ethernet/broadcom/tg3.c
index 04964bbe08cf..400451e10f77 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -18090,7 +18090,6 @@ static int tg3_suspend(struct device *device)
  {
  	struct net_device *dev = dev_get_drvdata(device);
  	struct tg3 *tp = netdev_priv(dev);
-	int err = 0;
   	rtnl_lock();
  @@ -18114,32 +18113,11 @@ static int tg3_suspend(struct device *device)
  	tg3_flag_clear(tp, INIT_COMPLETE);
  	tg3_full_unlock(tp);
-	err = tg3_power_down_prepare(tp);
-	if (err) {
-		int err2;
-
-		tg3_full_lock(tp, 0);
-
-		tg3_flag_set(tp, INIT_COMPLETE);
-		err2 = tg3_restart_hw(tp, true);
-		if (err2)
-			goto out;
-
-		tg3_timer_start(tp);
-
-		netif_device_attach(dev);
-		tg3_netif_start(tp);
-
-out:
-		tg3_full_unlock(tp);
-
-		if (!err2)
-			tg3_phy_start(tp);
-	}
+	tg3_power_down_prepare(tp);
   unlock:
  	rtnl_unlock();
-	return err;
+	return 0;
  }
   static int tg3_resume(struct device *device)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-29 15:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07 19:23 [PATCH] tg3: Remove residual error handling in tg3_suspend Nikita Kiryushin
2024-03-07 22:38 ` Michael Chan
2024-03-11 15:45   ` [PATCH v2] " Nikita Kiryushin
2024-03-11 17:22     ` Michael Chan
2024-03-26 18:35       ` [PATCH net-next " Nikita Kiryushin
2024-03-27  2:44         ` Ratheesh Kannoth
2024-03-27  3:24           ` Jakub Kicinski
2024-03-27  5:09             ` Michael Chan
2024-03-27  5:13               ` [EXTERNAL] " Ratheesh Kannoth
2024-03-29  1:10         ` Jakub Kicinski
2024-03-29 11:51           ` Nikita Kiryushin
2024-03-29 15:25             ` Jakub Kicinski

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).