Received: by 10.223.176.5 with SMTP id f5csp1055664wra; Tue, 6 Feb 2018 11:49:27 -0800 (PST) X-Google-Smtp-Source: AH8x225yF0WYaKcH2eP+Au/aHJlZ91Ug7wzRG9LWPGsiPsGy3dXV6ymgGDy28VjYVEAEnRGmMrmD X-Received: by 10.99.127.94 with SMTP id p30mr2819073pgn.154.1517946567230; Tue, 06 Feb 2018 11:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517946567; cv=none; d=google.com; s=arc-20160816; b=P2y42zVz33I72cf0Z1dYBHZLP6W5q7ylEVx9Hfif+6bJBaaAS+L8bgSi1FKFBazH2T M2p/I9SZBh15RoEUbVZXqOglKE0i+UMuuH9oOLT143HJVIiJbrWnltkXFec184CCBs1P rYk4Y4b/yC7edx6GsM52d2WluRIqc0vSDWX06EPWTOrhaBetL1I6Yf6N3zVc5ZC4bkcD tkgtqUqB/bd8iPq7uVdwK/WmiF6ptxY3+C1nfrLDOP94Jm8zJp81DJQw1evpsEvj3Zio hQW/Onx1YIOq9B7FpQFxklaVNjY9GmLtWu1AnYJoKUYe92B3dQ3bnfw1QweMgIfTkoEF GuxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Jba90ObBdZRrHewtBVNsgIm5/TH417slltw0Y3W4eHc=; b=LdnbjAaprR9PmNq4zmiYF1LoZDy8aS+M3zeH5VS8no0nwbkJctaWerVHCBUfsOlZy0 GqqjelxIWRpup0S5KgCjTiZFQdTYdnePdhgYC8gW1n2A67nWXZ+p6BWP/1338J+Y5UdU xqEDhXh4rG6TE3YmVGSlLAy5fu0ZDSwTIxwQnpoKGh5Dimzv+CYBHP3B7ezCmMLMUH2E 41KiwMc5eQwRrIbFVufeiDNXP5lBjB+c2HUhKonGH3jQvH0quNCEIFBYK6kJKB7kUMMl K5MiwocB4wvpSNm7F8A894JSK+6hzEbOixOlbsh2MMmrC5pU6gPsTXOtRW6GaZDeQLVr t77w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18-v6si1891565pls.191.2018.02.06.11.49.13; Tue, 06 Feb 2018 11:49:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753408AbeBFTsd convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Feb 2018 14:48:33 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:21397 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753064AbeBFTsb (ORCPT ); Tue, 6 Feb 2018 14:48:31 -0500 Received: from linux.numericable.fr ([77.198.79.136]) by mwinf5d56 with ME id 7XoN1x0072wTeBR03XoNFz; Tue, 06 Feb 2018 20:48:28 +0100 X-ME-Helo: linux.numericable.fr X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 06 Feb 2018 20:48:28 +0100 X-ME-IP: 77.198.79.136 From: Christophe JAILLET To: jeffrey.t.kirsher@intel.com Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] igb: Fix a test with HWTSTAMP_TX_ON Date: Tue, 6 Feb 2018 20:47:59 +0100 Message-Id: <20180206194759.26991-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Antivirus: Avast (VPS 180206-2, 06/02/2018), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'HWTSTAMP_TX_ON' should be handled as a value, not as a bit mask. The modified code should behave the same, because HWTSTAMP_TX_ON is 1 and no other possible values of 'tx_type' would match the test. However, this is more future-proof, should other values be allowed one day. See 'struct hwtstamp_config' in 'include/uapi/linux/net_tstamp.h' This fixes a warning reported by smatch: igb_xmit_frame_ring() warn: bit shifter 'HWTSTAMP_TX_ON' used for logical '&' Fixes: 26bd4e2db06be ("igb: protect TX timestamping from API misuse") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index c208753ff5b7..e945d1f7c7fe 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -5727,7 +5727,7 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { struct igb_adapter *adapter = netdev_priv(tx_ring->netdev); - if (adapter->tstamp_config.tx_type & HWTSTAMP_TX_ON && + if (adapter->tstamp_config.tx_type == HWTSTAMP_TX_ON && !test_and_set_bit_lock(__IGB_PTP_TX_IN_PROGRESS, &adapter->state)) { skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; -- 2.14.1 --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus