From patchwork Mon Sep 11 12:14:58 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: 13379263 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 3D5B7EE57DF for ; Mon, 11 Sep 2023 12:16:05 +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=NASfmjMSIm/RT7Rf0A/SkBAFzB3PvN7zXZtskZzmvxw=; b=hN7Sw+QCgmhaCj a3smTr1yZkOMyTVk/ywptB4ohCM6ReMIh5n9cRP8Z5Dl0QARUpKwN3jyAhxM32riI3adVU7FyqA/R p4j6VDIFStkZArtQjzWl08Ph/bVk0q0OtcX5CW/uYAOyDegOTxtB6TgClWcEZss0xP7wMyNJfpD3w 7LQfIEQAwli5C34xCsf0UP3v9GSEUWFUJBsQX04M8h3BEpio/Dv2fr2JKAtn65N2njcJF0a/43ywX RcXWu7hzfqsipSDUWW96w6E0Ph5CjAhkOmoy5Hwvpu1KsxItBeYdvA230TQdxURC+ebYh6vYLwxol VzoWNbEcAy7p/1teWoWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qffpJ-000Sz3-2O; Mon, 11 Sep 2023 12:15:37 +0000 Received: from mgamail.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qffpH-000SxZ-0M for linux-arm-kernel@lists.infradead.org; Mon, 11 Sep 2023 12:15:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694434535; x=1725970535; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=toOyW9LlXxM3sJdhFIcQPxDfWTfs2UZORrP5iweYkcs=; b=g7PEtYbu9xGK/RysG/Wh3U7Def5FizmT1Y87RilLn4QYmx2ZzFyuOi/G gM4W3mHGqFFRgbppkdFkwRldFi8cHdfJXRQXO8POJxOpJJX7uRgO8CRzP sl8EY6a9Tfz1GXscZ0Yx2bdmPlhcJuEnfSm/bBCYkLZ0BipwyYwSaCMyR +UlggFk8y/2IOtBLGV32ZJAPkp6ClJ3GdqvP0ARfxs/MJJ1VGwva21QYu NAHtgVospKMycZ0enhBs2RDVXLHMfpVkl4pnTgrBWjIksG0g6+aLv8fLK WOZw23yYFOVTaHAAdJYi1G6/BIggEAz8pFSR8K4hwIpSjRkoLPPHbV8oX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="381863560" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="381863560" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:15:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="746383313" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="746383313" Received: from mzarkov-mobl3.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.36.200]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:15:26 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: 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?= Subject: [PATCH 5/8] PCI: mvebu: Use FIELD_PREP() with Link Width Date: Mon, 11 Sep 2023 15:14:58 +0300 Message-Id: <20230911121501.21910-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230911121501.21910-1-ilpo.jarvinen@linux.intel.com> References: <20230911121501.21910-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-20230911_051535_211872_BCE45808 X-CRM114-Status: GOOD ( 10.57 ) 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 --- 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. */