Skip to contentSkip to conversation

e1000: remove unneeded conversion to bool

PATCH Applied Jason Yan 2 participants 2 messages Apr 20, 2020 – Apr 21, 2020

Subsystems (3)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 e1000: remove unneeded conversion to bool

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
conversion to bool not needed here

---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
index ac5146d53c4c..05bc6e216bca 100644
@@ -1476,7 +1476,7 @@ static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
 	if (hw->mac_type == e1000_82545 ||
 	    hw->mac_type == e1000_ce4100 ||
 	    hw->mac_type == e1000_82546) {
-		return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
+		return ((begin ^ (end - 1)) >> 16) == 0;
 	}
 
 	return true;
Signature · 1 line
2.21.1
maintainer Applied
#1 lore raw

From: Jason Yan <[email protected]>
Date: Mon, 20 Apr 2020 20:35:06 +0800

Quoted 7 lines

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
conversion to bool not needed here

Applied to net-next.