From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C8E8C433EF for ; Mon, 15 Nov 2021 11:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67AA261C32 for ; Mon, 15 Nov 2021 11:22:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231431AbhKOLZe (ORCPT ); Mon, 15 Nov 2021 06:25:34 -0500 Received: from mga14.intel.com ([192.55.52.115]:37308 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbhKOLXP (ORCPT ); Mon, 15 Nov 2021 06:23:15 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10168"; a="233667709" X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="233667709" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 03:20:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="503787458" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 15 Nov 2021 03:20:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 019B122B; Mon, 15 Nov 2021 13:20:03 +0200 (EET) From: Andy Shevchenko To: bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Quinlan , Nicolas Saenz Julienne , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas , Andy Shevchenko Subject: [PATCH v2 1/1] PCI: brcmstb: Use BIT() as __GENMASK() is for internal use only Date: Mon, 15 Nov 2021 13:20:00 +0200 Message-Id: <20211115112000.23693-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use BIT() as __GENMASK() is for internal use only. The rationale of switching to BIT() is to provide better generated code. The GENMASK() against non-constant numbers may produce an ugly assembler code. On contrary the BIT() is simply converted to corresponding shift operation. Note, it's the only user of __GENMASK() in the kernel outside of its own realm. Fixes: 3baec684a531 ("PCI: brcmstb: Accommodate MSI for older chips") Signed-off-by: Andy Shevchenko --- v2: switched to BIT() and elaborated why, hence not included tag drivers/pci/controller/pcie-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 1fc7bd49a7ad..0c49fc65792c 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -619,7 +619,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie) static void brcm_msi_set_regs(struct brcm_msi *msi) { - u32 val = __GENMASK(31, msi->legacy_shift); + u32 val = ~(BIT(msi->legacy_shift) - 1); writel(val, msi->intr_base + MSI_INT_MASK_CLR); writel(val, msi->intr_base + MSI_INT_CLR); -- 2.33.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBD8BC433F5 for ; Mon, 15 Nov 2021 11:21:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83A3A61C15 for ; Mon, 15 Nov 2021 11:21:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 83A3A61C15 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=U6oZST7F54qDBzFV6Wjy2y+HREsYOu/y+SLs+bNsUXg=; b=P7ljuZ7T9Gx/tu ZE/Ps/QZROweTSi2pQxXx8YuRGTkB95fJSSMaE14H3+ZkFyZGNWq+M1xWEo05cPx1AeFnJztQYeHq AROGaZjU8CFXQN6J6EAnikxvkWeRucQIbzO+ATqxYi6CMGTs+YhtQFf3YpW9DRjTIn5DCl8bdmyII +fk7TpPmG+aPF2DAMRS2cuqzs3yZy44tRqB0iZKTkO8GZJyfQJ7h31Y2OeZB3FAwvoDPN7k8iF2/J StFu9UdXbJ5zjU1zui1mmFxWrLz+EdtgOtOeXsdl4HXpAd7J0MAC+ngw4sAumX1X8GaN+8qGsQvie cfZmFDFhd0bsc0V+DKVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mma2R-00FKv1-7Y; Mon, 15 Nov 2021 11:20:39 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mma1v-00FKen-Ck; Mon, 15 Nov 2021 11:20:08 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10168"; a="257170742" X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="257170742" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 03:20:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="503787458" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 15 Nov 2021 03:20:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 019B122B; Mon, 15 Nov 2021 13:20:03 +0200 (EET) From: Andy Shevchenko To: bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Quinlan , Nicolas Saenz Julienne , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas , Andy Shevchenko Subject: [PATCH v2 1/1] PCI: brcmstb: Use BIT() as __GENMASK() is for internal use only Date: Mon, 15 Nov 2021 13:20:00 +0200 Message-Id: <20211115112000.23693-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211115_032007_502674_DA69DE2C X-CRM114-Status: GOOD ( 13.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use BIT() as __GENMASK() is for internal use only. The rationale of switching to BIT() is to provide better generated code. The GENMASK() against non-constant numbers may produce an ugly assembler code. On contrary the BIT() is simply converted to corresponding shift operation. Note, it's the only user of __GENMASK() in the kernel outside of its own realm. Fixes: 3baec684a531 ("PCI: brcmstb: Accommodate MSI for older chips") Signed-off-by: Andy Shevchenko --- v2: switched to BIT() and elaborated why, hence not included tag drivers/pci/controller/pcie-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 1fc7bd49a7ad..0c49fc65792c 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -619,7 +619,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie) static void brcm_msi_set_regs(struct brcm_msi *msi) { - u32 val = __GENMASK(31, msi->legacy_shift); + u32 val = ~(BIT(msi->legacy_shift) - 1); writel(val, msi->intr_base + MSI_INT_MASK_CLR); writel(val, msi->intr_base + MSI_INT_CLR); -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel