浏览代码

hamradio: Fix bit test correctly.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Thomas Sailer 15 年之前
父节点
当前提交
48bccd25df
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      drivers/net/hamradio/baycom_epp.c

+ 3 - 4
drivers/net/hamradio/baycom_epp.c

@@ -595,17 +595,16 @@ static int receive(struct net_device *dev, int cnt)
 					if (!(notbitstream & (0x1fc << j)))
 						state = 0;
 
-					/* not flag received */
-					else if ((bitstream & (0x1fe << j)) !=
-							(0x0fc << j)) {
+					/* flag received */
+					else if ((bitstream & (0x1fe << j)) == (0x0fc << j)) {
 						if (state)
 							do_rxpacket(dev);
 						bc->hdlcrx.bufcnt = 0;
 						bc->hdlcrx.bufptr = bc->hdlcrx.buf;
 						state = 1;
 						numbits = 7-j;
-						}
 					}
+				}
 
 				/* stuffed bit */
 				else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) {