net/hamradio: fix test in receive()
Subsystems (2)
PATCH 1/1 net/hamradio: fix test in receive()
The negation makes it a bool before the comparison and hence it will never evaluate to true.
Signed-off-by Roel Kluin <[email protected]>
---
Was this intended?
drivers/net/hamradio/baycom_epp.c +2 -1
@@ -596,7 +596,8 @@ static int receive(struct net_device *dev, int cnt) state =0 ;/* not flag received */ - else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) { + else if ((bitstream & (0x1fe << j)) != + (0x0fc << j)) {if (state)do_rxpacket (dev); bc->hdlcrx.bufcnt =0 ;
From: Roel Kluin <[email protected]>
Date: Tue, 06 Oct 2009 13:20:08 +0200
Quoted 4 lines
The negation makes it a bool before the comparison and hence it will never evaluate to true.
Signed-off-by Roel Kluin <[email protected]>
Applied to net-next-2.6, thanks.
Quoted 12 lines · On Tue, 06 Oct 2009 13:20:08 +0200 Roel Kluin <[email protected]> wrote:
The negation makes it a bool before the comparison and hence it will never evaluate to true.
Signed-off-by Roel Kluin <[email protected]>---
Was this intended?drivers/net/hamradio/baycom_epp.c +0
-0
drivers/net/hamradio/baycom_epp.c static int receive(struct net_device *dev, int cnt) · line 603
Quoted 9 lines
drivers/net/hamradio/baycom_epp.c +2
-1@@ -596,7 +596,8 @@ static int receive(struct net_device *dev, int cnt) state =0 ;/* not flag received */ - else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) { + else if ((bitstream & (0x1fe << j)) != + (0x0fc << j)) {if (state)do_rxpacket (dev); bc->hdlcrx.bufcnt =0 ;
It does look like that is what was intended.
With this fix we're turning on a code path which probably hasn't been executed by anyone in a decade or so. I wonder what it'll do?