Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327908 > unrolled thread

[PATCH] net: cavium: liquidio: fix check for in progress flag

Started byColin King <colin.king@canonical.com>
First post2016-02-05 17:40 +0100
Last post2016-02-05 17:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: cavium: liquidio: fix check for in progress flag Colin King <colin.king@canonical.com> - 2016-02-05 17:40 +0100

#1327908 — [PATCH] net: cavium: liquidio: fix check for in progress flag

FromColin King <colin.king@canonical.com>
Date2016-02-05 17:40 +0100
Subject[PATCH] net: cavium: liquidio: fix check for in progress flag
Message-ID<qYRAm-2Gm-17@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

smatch detected a suspicious looking bitop condition:

drivers/net/ethernet/cavium/liquidio/lio_main.c:2529
  handle_timestamp() warn: suspicious bitop condition

(skb_shinfo(skb)->tx_flags | SKBTX_IN_PROGRESS is always non-zero,
so the logic is definitely not correct.  Use & to mask the correct
bit.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/cavium/liquidio/lio_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 8727655..06b6be8 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -2524,7 +2524,7 @@ static void handle_timestamp(struct octeon_device *oct,
 
 	octeon_swap_8B_data(&resp->timestamp, 1);
 
-	if (unlikely((skb_shinfo(skb)->tx_flags | SKBTX_IN_PROGRESS) != 0)) {
+	if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) != 0)) {
 		struct skb_shared_hwtstamps ts;
 		u64 ns = resp->timestamp;
 
-- 
2.7.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web