[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1jNcy3d6amPwwF-FDGW41zjMUis20MbSN2O=RSABYuXA@mail.gmail.com>
Date: Fri, 12 Feb 2021 21:27:41 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Mihai Carabas <mihai.carabas@...cle.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
gregkh <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Randy Dunlap <rdunlap@...radead.org>,
Wang ShaoBo <bobo.shaobowang@...wei.com>
Subject: Re: [PATCH v3 1/3] misc/pvpanic: split-up generic and platform
dependent code
On Fri, Feb 12, 2021 at 8:32 PM Mihai Carabas <mihai.carabas@...cle.com> wrote:
>
> Split-up generic and platform dependent code in order to be able to re-use
> generic event handling code in pvpanic PCI device driver in the next patches.
>
> The code from pvpanic.c was split in two new files:
> - pvpanic.c: generic code that handles pvpanic events
> - pvpanic-mmio.c: platform/bus dependent code
>
> Signed-off-by: Mihai Carabas <mihai.carabas@...cle.com>
> ---
> drivers/misc/Kconfig | 9 +--
> drivers/misc/Makefile | 2 +-
> drivers/misc/pvpanic.c | 111 ------------------------------------
> drivers/misc/pvpanic/Kconfig | 19 ++++++
> drivers/misc/pvpanic/Makefile | 8 +++
> drivers/misc/pvpanic/pvpanic-mmio.c | 83 +++++++++++++++++++++++++++
> drivers/misc/pvpanic/pvpanic.c | 62 ++++++++++++++++++++
> drivers/misc/pvpanic/pvpanic.h | 17 ++++++
As mentioned, please use 'git format-patch -M' to make it easier to review
> +
> +config PVPANIC
> + bool "pvpanic device support"
> + help
> + This option allows to select a specific pvpanic device driver.
> + pvpanic is a paravirtualized device provided by QEMU; it lets
> + a virtual machine (guest) communicate panic events to the host.
> +
> +config PVPANIC_MMIO
> + tristate "pvpanic MMIO device support"
> + depends on HAS_IOMEM && (ACPI || OF) && PVPANIC
> + help
> + This driver provides support for the MMIO pvpanic device.
...
> +#
> +obj-$(CONFIG_PVPANIC) += pvpanic.o
> +obj-$(CONFIG_PVPANIC_MMIO) += pvpanic-mmio.o
This solves the problem that Greg pointed out, but now the core pvpanic
driver is always built-in even when it is only used from loadable modules.
The easiest way to express what you actually want is with a Makefile
trick:
obj-$(CONFIG_PVPANIC) += pvpanic.o pvpanic-pci.o
obj-$(CONFIG_PVPANIC_MMIO) += pvpanic.o pvpanic-mmio.o
When you do this, pvpanic.o is built-in when at least one of its
users is built-in, and otherwise it a loadable module when there
is at least one user, but it will not be built twice or with the wrong
flags.
Arnd
Powered by blists - more mailing lists