netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: micrel: Remove unnecessary comparison in lan8814_handle_interrupt
@ 2022-05-05  3:02 Wan Jiabing
  2022-05-05 12:13 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Wan Jiabing @ 2022-05-05  3:02 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: Wan Jiabing

Fix following coccicheck warning:
./drivers/net/phy/micrel.c:2679:6-20: WARNING: Unsigned expression compared with zero: tsu_irq_status > 0

Remove unnecessary comparison to make code better.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 drivers/net/phy/micrel.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 685a0ab5453c..6820882be59b 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2676,11 +2676,10 @@ static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev)
 		tsu_irq_status = lanphy_read_page_reg(phydev, 4,
 						      LAN8814_INTR_STS_REG);
 
-		if (tsu_irq_status > 0 &&
-		    (tsu_irq_status & (LAN8814_INTR_STS_REG_1588_TSU0_ |
-				       LAN8814_INTR_STS_REG_1588_TSU1_ |
-				       LAN8814_INTR_STS_REG_1588_TSU2_ |
-				       LAN8814_INTR_STS_REG_1588_TSU3_)))
+		if (tsu_irq_status & (LAN8814_INTR_STS_REG_1588_TSU0_ |
+				      LAN8814_INTR_STS_REG_1588_TSU1_ |
+				      LAN8814_INTR_STS_REG_1588_TSU2_ |
+				      LAN8814_INTR_STS_REG_1588_TSU3_))
 			lan8814_handle_ptp_interrupt(phydev);
 		else
 			break;
-- 
2.36.0


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

end of thread, other threads:[~2022-05-05 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-05  3:02 [PATCH] net: phy: micrel: Remove unnecessary comparison in lan8814_handle_interrupt Wan Jiabing
2022-05-05 12:13 ` Andrew Lunn
2022-05-05 12:37   ` Jiabing Wan
2022-05-05 12:47     ` Andrew Lunn
2022-05-05 13:42       ` Jiabing Wan
2022-05-05 14:09         ` Andrew Lunn

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