Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4564145pja; Thu, 21 Nov 2019 21:57:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyl9GxPUwDm2XD7V+/yjmrwn6l0SDApA8gulceuSyAqx7Pv9cmwx+b8Dl+OW/JbZ+DyX9qS X-Received: by 2002:a17:906:1fcf:: with SMTP id e15mr18964996ejt.317.1574402258867; Thu, 21 Nov 2019 21:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574402258; cv=none; d=google.com; s=arc-20160816; b=zAcUSBlRBRAQVNsEZr1ibWiZkFMQk9DMuNyEK+zXnM1YL3MLO3bSDFS847leQr0zxj 1sr56sdEwJv+dDBDiApmIKhF/iLM6wHo3P/H4/UdeqBr/69c+UBIhJC8oVLaeSKY6yZd +vb7qLhw8gCIH92Lu6Dyz6r8lKWHEJE/HUdE4h/IsFFmVbg39Jk+vSMrsw/BnpMNljJq JS88Pxfc80jWo3hPD6kf03Bb5XDrgT0DXaseeN585JXzXZWh92D2EXKQYCS6BpusK8dk OcBf6BGcQuuMopL/kdzeQvjqqOllGwcB6EGuoNsjINSMVCJuc+6ZkPpZAeoGZ/ST4Cjt By0A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+bBwTKHB/fqHob6BFwOim895gRsm6kdgPp7E6g4RLZE=; b=UaStH+Rl3RCUSYE9FJ/iHMHHBXs01/jpgzZQISTRF4CWjcorLjc+DKPu95k8Aya+/X xGpyX3tTllKJXnTajR39zAxX0tNVsMZ5IBOViDTO5euypNzXh/NBkgLe6mPzytJQ1Q1o sQ8GrAmjVFnAgkJwu7joj4tQd/LSq8DYxEzdpe+OdSuRWPoTgyJBETZyCFOmLNJRwuWm TA8bDPD8BVvgXx7jQ4QrIchqRiCP1w/nsvvJNquawcR79rm/FGNHMvkF4JeGO+esfKS7 +bcrBPAgVwea8Oa5WIdqlhBjcxLJJiQYQoXVG0KA9T34ZRaYZftyJLCrPZwhvsJTqztn ORvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XphGks6n; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si3782964edy.287.2019.11.21.21.57.15; Thu, 21 Nov 2019 21:57:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XphGks6n; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbfKVFxC (ORCPT + 99 others); Fri, 22 Nov 2019 00:53:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:58928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728732AbfKVFw7 (ORCPT ); Fri, 22 Nov 2019 00:52:59 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE5EC20721; Fri, 22 Nov 2019 05:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401978; bh=moSTdx0b15r8AFXw/a0cj2pHvsjwbdBEGVmg1DcRV+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XphGks6nOgYzFk/27SZ9DehYhkR/p8SpwqDjvGLZgdFpXkvEyD25cLv63bHGqtGP7 2eHot4LIx9kLKp2yLaSKFzTvA1TTv+xnOV1iwLHCDrTfXsgMH5tRu+tRlhoYhPRP6f 21wmlVnkxDniNtdoq7x4uBdotICD4Pl3dmPt+qF8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Shevchenko , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 197/219] net: dev: Use unsigned integer as an argument to left-shift Date: Fri, 22 Nov 2019 00:48:49 -0500 Message-Id: <20191122054911.1750-190-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit f4d7b3e23d259c44f1f1c39645450680fcd935d6 ] 1 << 31 is Undefined Behaviour according to the C standard. Use U type modifier to avoid theoretical overflow. Signed-off-by: Andy Shevchenko Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8c2fec0bcb265..5ada5fd9652dd 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3790,7 +3790,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) if (debug_value == 0) /* no output */ return 0; /* set low N bits */ - return (1 << debug_value) - 1; + return (1U << debug_value) - 1; } static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) -- 2.20.1