mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: dsa: Remove unsigned expression compared with zero
@ 2021-05-19 10:49 Jiapeng Chong
  2021-05-19 18:24 ` Vladimir Oltean
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-05-19 10:49 UTC (permalink / raw)
  To: andrew
  Cc: vivien.didelot, f.fainelli, olteanv, davem, kuba, linux, netdev,
	linux-kernel, Jiapeng Chong

Variable val is "u32" always >= 0, so val >= 0 condition are redundant.

Clean up the following coccicheck warning:

./drivers/net/dsa/qca8k.c:732:5-8: WARNING: Unsigned expression compared
with zero: val >= 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/dsa/qca8k.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 4753228..7b38b8d 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -729,8 +729,7 @@
 
 	mutex_unlock(&bus->mdio_lock);
 
-	if (val >= 0)
-		val &= QCA8K_MDIO_MASTER_DATA_MASK;
+	val &= QCA8K_MDIO_MASTER_DATA_MASK;
 
 	return val;
 }
-- 
1.8.3.1


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

end of thread, other threads:[~2021-05-19 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 10:49 [PATCH] net: dsa: Remove unsigned expression compared with zero Jiapeng Chong
2021-05-19 18:24 ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®