From patchwork Mon Sep 5 18:51:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12966475 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 14A75ECAAD5 for ; Mon, 5 Sep 2022 19:27:12 +0000 (UTC) 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=kR+jIvTqdVqQMjxon7xHR4wHiQHfyeqGzAuuCKaeF9w=; b=HqfjyqsO9PuVxv LjFPs5WTLiqwsXqEVCeugtlyvuo4LJdxu7VGfzzDyioLTCxcYMXaStfkDQcyu1vd8aQBpn5NDoFzj f24kheHUw/Kkvh8a0W7p5LDbqNCFIqbSFiTUu0xfKKxsuQkuWjNvQkBGOlSLsyOFxaj5qeb5jA5K7 x+YyR/7oFdW5EjbKOd1oCy7yu0gwWNUlxY0t7nVxEK3uFo239i/TUwcBXSvsUPwx1uvI5DQmjCQYD TNK82ctdR36efYIQl2k161khHSSg7iZBfVWkCscIWa7RcFYlgUMvZT0Tc28VAuRtALEKzEH9mjjLP VybEwmr5HPWGRgGsHGxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVHjL-009GPq-A4; Mon, 05 Sep 2022 19:26:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVHCh-008kQr-Sh for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 18:52:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 078A36145F; Mon, 5 Sep 2022 18:52:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4526FC433C1; Mon, 5 Sep 2022 18:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662403934; bh=V3DhFxwkMch9V2j0LUuXL2Z76OR6gdn4dJaqm2PVFrA=; h=From:To:Cc:Subject:Date:From; b=D8ZX/7+6iZhkm7DwdyXnnAUNzjMMjFr600fMjbbqj6JCiqX/uMRKAW08L1eh96dVM pztQTMKUi0MMS9SIfBxS9E68k8SVFZ8JScoc0wPjAk9MVu4TylXvBXB0IfdgjV2ddM VWtDoXN2Uq2KrHmYNPwJwiY3tNMlOtIsAa8DFASBrczcHrgpB94fWDgJVG4vk32twt DeOAEKl/CnsJBFaztcxsWC5tQrZqRNTNIGM+xXk1u+whduyrpjliDFY62vZkWnWaaz asRH6kz471je4aKjgDNgHThxhrRHpSdbzg8rq/2VIdOtkNJb0EVQmM1WhRKUAzIPXO 3y4fX8uF9i6Ag== Received: by pali.im (Postfix) id C5AF47D7; Mon, 5 Sep 2022 20:52:11 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Thomas Petazzoni Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] PCI: mvebu: use BIT() and GENMASK() macros instead of hardcoded hex values Date: Mon, 5 Sep 2022 20:51:49 +0200 Message-Id: <20220905185150.22220-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_115216_118600_8CF5A776 X-CRM114-Status: GOOD ( 11.50 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Pali Rohár --- drivers/pci/controller/pci-mvebu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 8bde4727aca4..c222dc189567 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -44,7 +44,7 @@ #define PCIE_WIN5_BASE_OFF 0x1884 #define PCIE_WIN5_REMAP_OFF 0x188c #define PCIE_CONF_ADDR_OFF 0x18f8 -#define PCIE_CONF_ADDR_EN 0x80000000 +#define PCIE_CONF_ADDR_EN BIT(31) #define PCIE_CONF_REG(r) ((((r) & 0xf00) << 16) | ((r) & 0xfc)) #define PCIE_CONF_BUS(b) (((b) & 0xff) << 16) #define PCIE_CONF_DEV(d) (((d) & 0x1f) << 11) @@ -70,13 +70,13 @@ #define PCIE_INT_ERR_MASK (PCIE_INT_ERR_FATAL | PCIE_INT_ERR_NONFATAL | PCIE_INT_ERR_COR) #define PCIE_INT_ALL_MASK GENMASK(31, 0) #define PCIE_CTRL_OFF 0x1a00 -#define PCIE_CTRL_X1_MODE 0x0001 +#define PCIE_CTRL_X1_MODE BIT(0) #define PCIE_CTRL_RC_MODE BIT(1) #define PCIE_CTRL_MASTER_HOT_RESET BIT(24) #define PCIE_STAT_OFF 0x1a04 -#define PCIE_STAT_BUS 0xff00 -#define PCIE_STAT_DEV 0x1f0000 #define PCIE_STAT_LINK_DOWN BIT(0) +#define PCIE_STAT_BUS GENMASK(15, 8) +#define PCIE_STAT_DEV GENMASK(20, 16) #define PCIE_SSPL_OFF 0x1a0c #define PCIE_SSPL_VALUE_SHIFT 0 #define PCIE_SSPL_VALUE_MASK GENMASK(7, 0)