From patchwork Tue Sep 19 12:56:45 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: 13391373 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 D48BDCD5BB3 for ; Tue, 19 Sep 2023 12:57:56 +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=Dgsrj+/EvxwZH0 bWfzpE2ehrueH4kvqp+BUUG/Px14jwEiL+yDDEAR9GLjYPHhRabvrDPJeNk0wvN5d9aOUZakrO+xK y6P7BePlsDWNGNOGjR9atvabdf/MuTy71Ss14yVYnqwVO5+3PFCYM5tzOIjeSoJRRDuGDvJXoduGh 5GMuV3631QcXn9BXIzywxm/EsAcr+RhAXHW5h1/0MREPbmcHp6U+ZrzvbM9s/zAa0eYgdahitBM5H MFqiCHqk7ZAff7CwT01U5YtP8jMuRz8N5KiFIumABRruWPjOvfprdQDz18nkhcdSEJ0nXKZfnmjaG SUj6KzXBs6F28splVuig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiaII-000TJT-2J; Tue, 19 Sep 2023 12:57:34 +0000 Received: from mgamail.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qiaIG-000TIp-2J for linux-arm-kernel@lists.infradead.org; Tue, 19 Sep 2023 12:57:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695128252; x=1726664252; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15ibo3GWRPJ9vDYwDbbj+Wf0aSNq2J9+768sCuoyD6A=; b=f96mkNbyChMhx2JMbPpM7Kd0ZxHCmuGsR7aMwGTxTkLt/BbMvgy6bQzd h3ATSUpnfI1AbR1RzoNlqpdJ5C7LbTKe28yso3bntPYK/8Kl303m9hYjk OUGvIsebpQmF1WtQ5FQvnlnw4kdob8VGOvkyCDidnz0Dw24MSM00Ew/2z DbsV8H63ZlkAuWJnrAzlX7sSA1K0i8dqpeRIigIQ2qLtCCgcfZ+/VVTer wrB1vqf4zhYUESdbWohaemqopCmN/IkkcNPAPKEs7vxwFAUGURKttnaFt u3AUvUW9OwQJNiRaOwlXgKIq5N1ZFoGV9hCXKzepqjEQMIi95zi7HUmSf g==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="359324699" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="359324699" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 05:57:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="746228825" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="746228825" Received: from vdesserx-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.249.32.31]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 05:57:26 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Jonathan Cameron , Thomas Petazzoni , =?utf-8?q?Pali_Roh=C3=A1r?= , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v3 5/8] PCI: mvebu: Use FIELD_PREP() with Link Width Date: Tue, 19 Sep 2023 15:56:45 +0300 Message-Id: <20230919125648.1920-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230919125648.1920-1-ilpo.jarvinen@linux.intel.com> References: <20230919125648.1920-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-20230919_055732_782410_656DC5BA X-CRM114-Status: GOOD ( 12.73 ) 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. */