From patchwork Mon Aug 2 15:21:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 490361 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp2025598jas; Mon, 2 Aug 2021 08:22:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyE64qcYJxktpo+3LXvdtv2jfbXpbKfVC4BjPxf1VXmo/hfLs50msn5XX9Gd8IS5+HCb6ap X-Received: by 2002:a6b:1685:: with SMTP id 127mr2138452iow.135.1627917730351; Mon, 02 Aug 2021 08:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627917730; cv=none; d=google.com; s=arc-20160816; b=omo2Hr37BetKuNe4ZKrIyJ5nj4gyL4E2zqnZSvL7NbaiST/aKmbEPW5+GlzLZYhmEV /a7+FcnpsudRQgcj6/z93H4mjmlKS0uAVvSusiqu2p7JG3b+rQ6c01RaytNGBRl9QFDo 8ytfu/rvKVQFNJVefN7v9lM7FgrH1pzERYKxZqldhLTqmL1A2ZuVJ2vu5a27UE6TEGF1 1YayIy3laGQeT0uFV0mJU66hqkf4YYp6QlJg5ZtlKt82UwtY096p7Bd9Ad/aQKRkLe+0 P/6RxZTcbp8b6ruEfDmzt+DYVrB+jnacab7iK7EP/MJrAqpbaav5RTIWfI64QSgUd+hg BZew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=w3IZhY8q8T7hXUEXjpVaGtjA9wLWCVOW0WMt08TdxYA=; b=je8DgQ3phy2Suaks1lQGL0CbSjQFWLFXlVfnG8HHVi4wePlsayLm2eWkLPuX3HySZ6 PdOhUk/WXVcDCXJngSRZ5uo7zaOqYNPXldFQ8wj5sRquKki0jh+MWEtXEOc4ftgei8yc TwspR9t+Svto/cqJhgeB5KnlKcqlSc6vPreWuG/32xKkmrqfgjqXykEpUYtB4t6lxRsx RpMC2cCMcIKCHdQwYLCneN2D/UoBrBFfAM2q+aRbbFKS4blBDpRjTN9q3DZ00BU22Qy5 qJA9OFf0x8oIMbht6RUaJKm4YrPI5ATQ44c3kBbe1Y3tm4DauPjYbaJO6XKbkMTKSTza Zvkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ERMtwfPG; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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. [23.128.96.18]) by mx.google.com with ESMTP id q5si12194179jaj.40.2021.08.02.08.22.10; Mon, 02 Aug 2021 08:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ERMtwfPG; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S234885AbhHBPWR (ORCPT + 8 others); Mon, 2 Aug 2021 11:22:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:38238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234603AbhHBPWQ (ORCPT ); Mon, 2 Aug 2021 11:22:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64E5A60725; Mon, 2 Aug 2021 15:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627917726; bh=scBi9JQGesVoVdIDm8pTXxoX8QYbu2/TP4O6Bq8cYIc=; h=From:To:Cc:Subject:Date:From; b=ERMtwfPGy17ZOZXbqimbuLFIscdtR/cPoILVcD7UMRwQaifZp9aGX/YtHZYfJeafK xC+lPSE3hVAYoaGGbpEz6OTaq6oAVae70OrCSGJjIhSHv5YqNgXl87uuUccd/MIGaf eKmF5G3uBv7lJuahx3AOKXkzWZZSoWkdOoAEJTSCvqIG7G11lXRGxpJ2yDsGWGmsbd eB6PnxBSKSF+01wgU/drkbNzVG0c50MSKHFTFTYtSiEvna5bTFq+uYIbq55Oj2VEtv 72DcLW8dQP9RMVeOLV1s9bEJ6gUY0NSSpuoF6utqzpEiGSta6lbGAwp/JbsrF/Wgb3 bwV46o/WQSGwA== From: Arnd Bergmann To: "David S. Miller" , Jakub Kicinski , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Bjarni Jonasson Cc: Arnd Bergmann , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: sparx5: fix bitmask on 32-bit targets Date: Mon, 2 Aug 2021 17:21:53 +0200 Message-Id: <20210802152201.1158412-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann I saw the build failure that was fixed in commit 6387f65e2acb ("net: sparx5: fix compiletime_assert for GCC 4.9") and noticed another issue that was introduced in the same patch: Using GENMASK() to create a 64-bit mask does not work on 32-bit architectures. This probably won't ever happen on this driver since it's specific to a 64-bit SoC, but it's better to write it portably, so use GENMASK_ULL() instead. Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c index 1a240e6bddd0..cb68eaaac881 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c @@ -32,7 +32,7 @@ static void __ifh_encode_bitfield(void *ifh, u64 value, u32 pos, u32 width) u32 byte = (35 - (pos / 8)); /* Calculate the Start bit position in the Start IFH byte */ u32 bit = (pos % 8); - u64 encode = GENMASK(bit + width - 1, bit) & (value << bit); + u64 encode = GENMASK_ULL(bit + width - 1, bit) & (value << bit); /* The b0-b7 goes into the start IFH byte */ if (encode & 0xFF)