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 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 68BB4C61D9B for ; Wed, 22 Nov 2023 13:15:21 +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:Message-ID: In-Reply-To:Subject:cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KGTGld/qynb9fVL4UK0NlX+P1j2HwOCGbDSQqsxs5w4=; b=XqIh/w2t6jQOB+ DeXxAnAIyMFYXxXLo9rmheVWIUcUigXqmWlhxPt3pWzeZptm/fVsfT+ymYAsk/Jlolbla7ZRyUTN+ sucIxYypy5EYSsTaA2FdZ2PD1TI+hvyH4uxMVZ2pKno99by2cfW+w992IJkEf7C4N25mYGX0hrw1D IgfHowA4D8Hnl+l6mLmGdDrU/P/V8lrU0BkUgKhkXzhDQzO4N6FV4AwrTcjlgoVZu14C1v7/hSTs8 D8uZ1GK0xa4Gl64JcHeI2yBcZPpiaxHlYWrXQJmwPe2rbR7YCfTMaGFGcIG8KP+h6guZW2+Z+n7td VQKIy+1gmOidlA+NSSpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5n4D-001v2v-07; Wed, 22 Nov 2023 13:14:57 +0000 Received: from mgamail.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5n4A-001v0i-0b for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2023 13:14:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700658894; x=1732194894; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ytXM2Pyec8Qp9LaXAdCOR2oRjgWxjhxu7pHl5+cR+4w=; b=mFQZOZ/um1uFZJoPGZIKVVsfh70QW8hEViqVUkDo1hRshfEI4kqp+c0O S876zIfkCPRwiVe+hI2tV7pieBk6L0LjYmyNwz9NtfsyGdUeGA+hG8OZt ZYb6zPBnKpp0dT2TauhGcQGwWdQe7eOf+YibcPgMjo7/ICkMT+bwKGenw q7WCCZWm4Aws+3KyO3RKxbfP1mWKLShMSQHOZVCVzhwYuPrOtjGQhQzDm SP/PF+rghTc8xPsVrpt7Me/8yKn1h+O3HE1d7FI4+JhI9gpFE9gQd/WTk Oe/mA9pwK0zmxSAY4LX0U+eheD69UTnu6uzUoXavFqd79zYcEvj2fGRYE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="390908486" X-IronPort-AV: E=Sophos;i="6.04,218,1695711600"; d="scan'208";a="390908486" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 05:14:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="857728170" X-IronPort-AV: E=Sophos;i="6.04,218,1695711600"; d="scan'208";a="857728170" Received: from johannes-ivm.ger.corp.intel.com ([10.249.47.139]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 05:14:44 -0800 Date: Wed, 22 Nov 2023 15:14:41 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Shuai Xue cc: ilkka@os.amperecomputing.com, kaishen@linux.alibaba.com, helgaas@kernel.org, yangyicong@huawei.com, will@kernel.org, Jonathan.Cameron@huawei.com, baolin.wang@linux.alibaba.com, robin.murphy@arm.com, chengyou@linux.alibaba.com, LKML , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, rdunlap@infradead.org, mark.rutland@arm.com, zhuo.song@linux.alibaba.com, renyu.zj@linux.alibaba.com Subject: Re: [PATCH v11 3/5] PCI: Move pci_clear_and_set_dword() helper to PCI header In-Reply-To: <20231121013400.18367-4-xueshuai@linux.alibaba.com> Message-ID: References: <20231121013400.18367-1-xueshuai@linux.alibaba.com> <20231121013400.18367-4-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231122_051454_233854_7DB2641C X-CRM114-Status: GOOD ( 15.36 ) 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 On Tue, 21 Nov 2023, Shuai Xue wrote: > The clear and set pattern is commonly used for accessing PCI config, > move the helper pci_clear_and_set_dword() from aspm.c into PCI header. > In addition, rename to pci_clear_and_set_config_dword() to retain the > "config" information and match the other accessors. > > No functional change intended. > > Signed-off-by: Shuai Xue > Acked-by: Bjorn Helgaas > Tested-by: Ilkka Koskinen > --- > drivers/pci/access.c | 12 ++++++++ > drivers/pci/pcie/aspm.c | 65 +++++++++++++++++++---------------------- > include/linux/pci.h | 2 ++ > 3 files changed, 44 insertions(+), 35 deletions(-) > > diff --git a/drivers/pci/access.c b/drivers/pci/access.c > index 6554a2e89d36..6449056b57dd 100644 > --- a/drivers/pci/access.c > +++ b/drivers/pci/access.c > @@ -598,3 +598,15 @@ int pci_write_config_dword(const struct pci_dev *dev, int where, > return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); > } > EXPORT_SYMBOL(pci_write_config_dword); > + > +void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos, > + u32 clear, u32 set) Just noting that annoyingly the ordering within the name is inconsistent between: pci_clear_and_set_config_dword() and pcie_capability_clear_and_set_dword() And if changed, it would be again annoyingly inconsistent with pci_read/write_config_*(), oh well... And renaming pci_read/write_config_* into the hierarchical pci_config_read/write_*() form for would touch only ~6k lines... ;-D > + pci_clear_and_set_config_dword(child, > + child->l1ss + PCI_L1SS_CTL1, 0, > + cl1_2_enables); Adding clear and set only variants into the header like there are for pcie_capability_*() would remove the need to add those 0 parameters. IMO, it improves code readability considerably. -- i. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel