Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1553942ybd; Wed, 26 Jun 2019 20:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVg5TgVfhiRZ0H8XImCXyvrVnCMbzvOd6ynqUXGwp98mYUiwTOHKfgvmtNsKjEwS4rvf3S X-Received: by 2002:a63:dc56:: with SMTP id f22mr1469171pgj.305.1561606124044; Wed, 26 Jun 2019 20:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561606124; cv=none; d=google.com; s=arc-20160816; b=yJayuEigIH/z0VP87uJsdfjNsJXgWKrM8oyO+Vq1zDzGtxE+uaHqneEJS/RQcPRV0R XbuHcxvsfYcbKU8igKisjHaqWCWxwwMtkMd1wEWku8h+6+ZCAiMxpBCC6qC04fdpuxSZ v1UBu7AWjuambZ0+ifQJRtMBEfCjJYxjfL8/n7Q2LVs9UUwAQXICqH935RCnaOO+IXfv EwQUBanmxnHKEYdKQf2PstL7dlXBZGUfbmf4E5pry0FtFXcOka/tyE1Trmhy0oWF1qQA m6Z6p59KaApXIB152juPsijcdodJQgoxbhBGifciU3hWOnf+askyxumEz+VasuqwvCq9 XLrA== 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:dkim-signature; bh=HjN3R4taWV9ZkzqtfFfYqtTJoGWa+sVZ87kMP8YXV64=; b=cDfRNO3Y7wGPuqsF106r84+Roh8OkKpywQG4pehfHEJheFb5W54EOjKRYdZa7y3q+2 ecV02V2XD5ALdN3CyrzR60di5rMXFWvI/Omp5doYr2qtDMZtSzsMPTH+tCiZhH5+yxpN S28PNE5C6OtO7rmYsBRcQWBAqMUXWHb0q1NNM0GuqD/qttdtcTe6YTCgIvhIg4RTeY8w tJyEHczTJiehyjpXRn1MoswS5rrvOImATZhfZRo15FPWsvTCGo+pFSyNJHuCoxE8d8Ms rOFb+u2vom5pJqnVBDBioayJLk5Lwd68EjJklu3ii0XafPWfd9sNRchgkIFWJkzx10TZ xbaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="p73g0i/l"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si898203pgd.544.2019.06.26.20.28.27; Wed, 26 Jun 2019 20:28:44 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="p73g0i/l"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfF0DZf (ORCPT + 99 others); Wed, 26 Jun 2019 23:25:35 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:39537 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfF0DZf (ORCPT ); Wed, 26 Jun 2019 23:25:35 -0400 Received: by mail-ot1-f66.google.com with SMTP id r21so99567otq.6 for ; Wed, 26 Jun 2019 20:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HjN3R4taWV9ZkzqtfFfYqtTJoGWa+sVZ87kMP8YXV64=; b=p73g0i/lWc+fOBoO5RiaEgcznFDaujrFRpK8nrpjNqvGjrawC2EaPVvV4w+W4qMSNj kPn5pFRhuvQUd9x2sgIAVHXF2eeTLxWFP/Q58yokH46HloqfSSpAeKShM5EbcaODu9M6 QznKz+hpJersSvp2oXpnu1SX3GtQQFR6urwFGAEDK4trHAPFepXs+Gg0ZVamM/NH5T11 6avK6vXC6QN0QSrYQ+Une0tiKfRAHPum6xt4rRhPYQzmiH1CKrAdACQCVRJFkhGJR76J GshTMOVTzJFEPyZKt49AKANlEsI5xpd9uxfcHBqSRQ7LzU3VYAkPffH6bH40AxELynMj DbrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HjN3R4taWV9ZkzqtfFfYqtTJoGWa+sVZ87kMP8YXV64=; b=K+cVrzLf8pKOsG+DRae+teZ2HiesynZZmEm2yutvaaZf8oBM1LoJIkWKf5oke4x8km 4CctEk3oMOfMxkAyF8mJWfnPQxqAiepe5uf+pVlfjiz1UgzzWAIBgCXgc2PJE10tFQ6u MuV27/BqiCHtiMk6u/mlB+EFSMFSaRoGxFh6G4IT3RSI0fkkXneoyptbcueZ2HNSrFlW DR4GWfChJKj12FbXFIgDih69NZxBNMhuORIUoiAKKA/ZrzqcwFYJRhfm4LTZE/rpHqsw ZjtvDMhehng8noLp/DtMXdvQ3wZitfaTaXH6QP4zkRVcZY9hG/VlYc7qpqJ9zICIGW4b Ir5w== X-Gm-Message-State: APjAAAWdl6x+NPHdz/K9tonsduaMjTrdfQM8yLh22wyk1AuzWb/ai8Dx adFlaz07PBxmrkT2A/agg/E= X-Received: by 2002:a9d:6385:: with SMTP id w5mr1320187otk.227.1561605934166; Wed, 26 Jun 2019 20:25:34 -0700 (PDT) Received: from rYz3n.attlocal.net ([2600:1700:210:3790::48]) by smtp.googlemail.com with ESMTPSA id y184sm417647oie.33.2019.06.26.20.25.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 20:25:33 -0700 (PDT) From: Jiunn Chang To: skhan@linuxfoundation.org Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, davem@davemloft.net Subject: [Linux-kernel-mentees][PATCH] ethtool: Fix undefined behavior in bit shift Date: Wed, 26 Jun 2019 22:25:29 -0500 Message-Id: <20190627032532.18374-1-c0d1n61at3@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Signed-off-by: Jiunn Chang --- include/uapi/linux/ethtool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 3534ce157ae9..859b2e99c000 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -1691,7 +1691,7 @@ static inline int ethtool_validate_duplex(__u8 duplex) #define RXH_IP_DST (1 << 5) #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */ #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */ -#define RXH_DISCARD (1 << 31) +#define RXH_DISCARD (1U << 31) #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL #define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL -- 2.22.0