From patchwork Wed Sep 13 12:27:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13382953 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 4921DEDEC4A for ; Wed, 13 Sep 2023 12:31:14 +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:References:In-Reply-To: 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: List-Owner; bh=8oVcypnDgVs4J0CEQx42OLRbjxEXU6ZbLnMJC9FWyv4=; b=Fk2DT5xGHARzpn hoENc/5OYBpyx1WOQQwkmKnKAizyos5vJWv1yggC667SWrK3YBnOy6nKWsMfu1cV9sagTlPoy0bQ8 ARTjfgp85ZACiBW9TB0Cl4AqYLNtdxbE2sTH3CBWZ1m224dV9bu8k8fdsjmKXlAboXvstgPuQL7UU PLcwknJSk2zmyvGzcMkS7FX1NbBC8ezmVk0arpQQVtmm2qhf3wDITg+akpIbuIf0FvThOoXixMexr KqjsDy1TdeYWvZfHCpFfHSDb6nvrcBzFWG7rgHYHsortW0tyufN/IytcCHaRODf74E0l8f26Fz74Z 2K0ILEf8x3G6l2uLf9GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgP16-005rfM-1v; Wed, 13 Sep 2023 12:30:48 +0000 Received: from mgamail.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgP13-005rdy-2t for linux-arm-kernel@lists.infradead.org; Wed, 13 Sep 2023 12:30:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694608245; x=1726144245; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15ibo3GWRPJ9vDYwDbbj+Wf0aSNq2J9+768sCuoyD6A=; b=Nix364H6Fspqz8gx8vBVOh33YkGuowo3pP4/+n1bE0kTGfnOgFTTtbgd JGcV3kpmfMQvv9C5BuQ6oBNzO6A3hMpplrKY0/hgT7zv/ZWdYDzhp7g0y 9X8M7gubqUeKtpYhv3PIcq9/3NYbB9mFF7WdDbrMdmaBkXHfLMu+QrRe8 qtjd3rUBSDHMYlm9ihjg2FCz2Qe/miNfV/46Vi1OxzEmDXwoWt4XNT+hm M2tiaSLmRoEIrqn/Hnfsk9KXc2iLQj3oMwIz4gu06l2+vL2nRovkXEjxQ +UWj2WdUOofxyOUK0bupEvM1R1Vae508Yivmm55/68p5qz8dCxsj9hLEE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="368912503" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="368912503" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 05:28:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="693836647" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="693836647" Received: from pakurapo-mobl3.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.249.45.213]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 05:28:18 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Jonathan Cameron , linux-pci@vger.kernel.org, Bjorn Helgaas , Thomas Petazzoni , =?utf-8?q?Pali_Roh=C3=A1r?= , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Jonathan Cameron Subject: [PATCH v2 05/10] PCI: mvebu: Use FIELD_PREP() with Link Width Date: Wed, 13 Sep 2023 15:27:43 +0300 Message-Id: <20230913122748.29530-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230913122748.29530-1-ilpo.jarvinen@linux.intel.com> References: <20230913122748.29530-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230913_053046_201112_CDEB45BF X-CRM114-Status: GOOD ( 12.27 ) 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 mvebu_pcie_setup_hw() setups the Maximum Link Width field in the Link Capabilities registers using an open-coded variant of FIELD_PREP() with a literal in shift. Improve readability by using FIELD_PREP(PCI_EXP_LNKCAP_MLW, ...). Signed-off-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron --- drivers/pci/controller/pci-mvebu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 60810a1fbfb7..29fe09c99e7d 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -264,7 +264,7 @@ static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port) */ lnkcap = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP); lnkcap &= ~PCI_EXP_LNKCAP_MLW; - lnkcap |= (port->is_x4 ? 4 : 1) << 4; + lnkcap |= FIELD_PREP(PCI_EXP_LNKCAP_MLW, port->is_x4 ? 4 : 1); mvebu_writel(port, lnkcap, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP); /* Disable Root Bridge I/O space, memory space and bus mastering. */