Pārlūkot izejas kodu

[build] Fix dubious uses of bitwise operators

Detected by sparse.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 gadus atpakaļ
vecāks
revīzija
4678864ce6
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1
    1
      src/drivers/net/rtl818x/rtl8185_rtl8225.c
  2. 1
    1
      src/net/fcoe.c

+ 1
- 1
src/drivers/net/rtl818x/rtl8185_rtl8225.c Parādīt failu

@@ -71,7 +71,7 @@ static void rtl8225_write(struct net80211_device *dev, u8 addr, u16 data)
71 71
 	udelay(10);
72 72
 
73 73
 	for (i = 15; i >= 0; i--) {
74
-		u16 reg = reg80 | !!(bangdata & (1 << i));
74
+		u16 reg = ( reg80 | ( ( bangdata >> i ) & 1 ) );
75 75
 
76 76
 		if (i & 1)
77 77
 			rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg);

+ 1
- 1
src/net/fcoe.c Parādīt failu

@@ -1011,7 +1011,7 @@ static void fcoe_expired ( struct retry_timer *timer, int over __unused ) {
1011 1011
 	/* Increment the timeout counter */
1012 1012
 	fcoe->timeouts++;
1013 1013
 
1014
-	if ( vlan_can_be_trunk ( fcoe->netdev ) &
1014
+	if ( vlan_can_be_trunk ( fcoe->netdev ) &&
1015 1015
 	     ! ( fcoe->flags & FCOE_VLAN_TIMED_OUT ) ) {
1016 1016
 
1017 1017
 		/* If we have already found a VLAN, send infrequent

Notiek ielāde…
Atcelt
Saglabāt