From nobody Sun Dec 28 21:15:46 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22E05C10DCE for ; Tue, 5 Dec 2023 17:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346106AbjLERXT (ORCPT ); Tue, 5 Dec 2023 12:23:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345550AbjLERXR (ORCPT ); Tue, 5 Dec 2023 12:23:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B70C0 for ; Tue, 5 Dec 2023 09:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701797002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tEi7wv7QZl2s4sbtmNX6yC+kQMQhn1gNlg651IagIrk=; b=Mt6f2G5tDYamOtgN9Xqir5Fi3pS+beVEYLzJyM7BDpWk3Jopv2QssS7GQxhXwVu90bMZbM SNez0e9fQn2BoRjBT4H4jhVZoSoVjndjmFa8pY4jpjONMCi4zjCedaxnLqR2JeiQbbxTyp nmA/6cv50zSft1z9gCenbgsKrYbdZX8= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-b-pJrCd-NZObOQwVT2qfiw-1; Tue, 05 Dec 2023 10:38:02 -0500 X-MC-Unique: b-pJrCd-NZObOQwVT2qfiw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-50bf2afb38fso376824e87.1 for ; Tue, 05 Dec 2023 07:38:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701790676; x=1702395476; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tEi7wv7QZl2s4sbtmNX6yC+kQMQhn1gNlg651IagIrk=; b=CmN/CZa9I54IZyHfcxcFWEZhwktekjyo+6HAST7rk6K58wDWJFOmqAgozEXGpzwTp3 vs3X4Cf/gKj0gE1Bf2bu+sv4WmmQuOnCvt/xpUpKl4Ilalru85AZtxT2L1bXNiuc7bXQ YlrUxNlMLiRaVucbSgo2pLgT9sI6fOTuy1l/SBF+jcdZ/TdeaZI91oopUCLRB+5CBrto WQoRee6UqDIuZS3fCIR0Uge7p/qoos3khKqz7WGr7DJqyC8e7AiiAw2rbcFJIuzA+IHn xxWQozCspdwFSKi/aE4hYvCqIUFSSjqddElmfk+HT5DhiCTTp+Yt8bixKJyFmypYSqVK GpNg== X-Gm-Message-State: AOJu0YyRk8x2Qj22QiKakiMuCHcwDofrsexXKa4f1373IX7bd5o243EG kUK5PJOCZqESs4TDEOPodpRJaeO6bM7O+2fH7PifdeZm0WgPhw3ybpY5GBes+XM7xK2eeAkjlL/ XWCN3g0OZPapg7PZz6ji7xjN7 X-Received: by 2002:a05:6512:1111:b0:50b:f26b:62c7 with SMTP id l17-20020a056512111100b0050bf26b62c7mr4729373lfg.6.1701790676556; Tue, 05 Dec 2023 07:37:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGqMTlJ14Gf928cMDlm5yh3tCedSPeZ4SuUa6eCkLFuz+1zQTJ8Zd0HpQ56sRzZ/milPk0pQ== X-Received: by 2002:a05:6512:1111:b0:50b:f26b:62c7 with SMTP id l17-20020a056512111100b0050bf26b62c7mr4729361lfg.6.1701790676236; Tue, 05 Dec 2023 07:37:56 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.remote.csb ([2a01:599:912:71c8:c243:7b37:30b:a236]) by smtp.gmail.com with ESMTPSA id r15-20020a056402018f00b0054c21d1fda7sm1244578edv.1.2023.12.05.07.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:37:55 -0800 (PST) From: Philipp Stanner To: Bjorn Helgaas , Arnd Bergmann , Johannes Berg , Randy Dunlap , NeilBrown , John Sanpe , Kent Overstreet , Niklas Schnelle , Philipp Stanner , Dave Jiang , Uladzislau Koshchanka , "Masami Hiramatsu (Google)" , David Gow , Kees Cook , Rae Moar , Geert Uytterhoeven , "wuqiang.matt" , Yury Norov , Jason Baron , Thomas Gleixner , Marco Elver , Andrew Morton , Ben Dooks , dakr@redhat.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v4 2/5] lib: move pci_iomap.c to drivers/pci/ Date: Tue, 5 Dec 2023 16:36:27 +0100 Message-ID: <20231205153629.26020-4-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205153629.26020-2-pstanner@redhat.com> References: <20231205153629.26020-2-pstanner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This file is guarded by an #ifdef CONFIG_PCI. It, consequently, does not belong to lib/ because it is not generic infrastructure. Move the file to drivers/pci/ and implement the necessary changes to Makefiles and Kconfigs. Suggested-by: Danilo Krummrich Signed-off-by: Philipp Stanner Reviewed-by: Arnd Bergmann --- drivers/pci/Kconfig | 5 +++++ drivers/pci/Makefile | 1 + lib/pci_iomap.c =3D> drivers/pci/iomap.c | 3 --- lib/Kconfig | 3 --- lib/Makefile | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) rename lib/pci_iomap.c =3D> drivers/pci/iomap.c (99%) diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 74147262625b..d35001589d88 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -13,6 +13,11 @@ config FORCE_PCI select HAVE_PCI select PCI =20 +# select this to provide a generic PCI iomap, +# without PCI itself having to be defined +config GENERIC_PCI_IOMAP + bool + menuconfig PCI bool "PCI support" depends on HAVE_PCI diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index cc8b4e01e29d..64dcedccfc87 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -14,6 +14,7 @@ ifdef CONFIG_PCI obj-$(CONFIG_PROC_FS) +=3D proc.o obj-$(CONFIG_SYSFS) +=3D slot.o obj-$(CONFIG_ACPI) +=3D pci-acpi.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) +=3D iomap.o endif =20 obj-$(CONFIG_OF) +=3D of.o diff --git a/lib/pci_iomap.c b/drivers/pci/iomap.c similarity index 99% rename from lib/pci_iomap.c rename to drivers/pci/iomap.c index 6e144b017c48..91285fcff1ba 100644 --- a/lib/pci_iomap.c +++ b/drivers/pci/iomap.c @@ -9,7 +9,6 @@ =20 #include =20 -#ifdef CONFIG_PCI /** * pci_iomap_range - create a virtual mapping cookie for a PCI BAR * @dev: PCI device that owns the BAR @@ -178,5 +177,3 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p) EXPORT_SYMBOL(pci_iounmap); =20 #endif /* ARCH_WANTS_GENERIC_PCI_IOUNMAP */ - -#endif /* CONFIG_PCI */ diff --git a/lib/Kconfig b/lib/Kconfig index 3ea1c830efab..1bf859166ac7 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -70,9 +70,6 @@ source "lib/math/Kconfig" config NO_GENERIC_PCI_IOPORT_MAP bool =20 -config GENERIC_PCI_IOMAP - bool - config GENERIC_IOMAP bool select GENERIC_PCI_IOMAP diff --git a/lib/Makefile b/lib/Makefile index 6b09731d8e61..0800289ec6c5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -153,7 +153,6 @@ CFLAGS_debug_info.o +=3D $(call cc-option, -femit-struc= t-debug-detailed=3Dany) obj-y +=3D math/ crypto/ =20 obj-$(CONFIG_GENERIC_IOMAP) +=3D iomap.o -obj-$(CONFIG_GENERIC_PCI_IOMAP) +=3D pci_iomap.o obj-$(CONFIG_HAS_IOMEM) +=3D iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) +=3D check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) +=3D locking-selftest.o --=20 2.43.0