char: ipmi: Handle HAS_IOPORT dependencies
cover char: ipmi: Handle HAS_IOPORT dependencies
Hi Corey,
This is a follow up in my ongoing effort of making inb()/outb() and similar I/O port accessors compile-time optional. Previously I sent this as a treewide series titled "treewide: Remove I/O port accessors for HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant subset of patches merged I've changed over to per-subsystem series. These series are stand alone and should be merged via the relevant tree such that with all subsystems complete we can follow this up with the final patch that will make the I/O port accessors compile-time optional.
The current state of the full series with changes to the remaining subsystems and the aforementioned final patch can be found for your convenience on my git.kernel.org tree in the has_ioport_v6 branch[1] with signed tags. As for compile-time vs runtime see Linus' reply to my first attempt[2].
Thanks,
Niklas
[0] https://lore.kernel.org/all/[email protected]/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=has_ioport_v6
[2] https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/
Niklas Schnelle (1):
char: ipmi: handle HAS_IOPORT dependencies
drivers/char/ipmi/Makefile | 11 ++++------- drivers/char/ipmi/ipmi_si_intf.c | 3 ++- drivers/char/ipmi/ipmi_si_pci.c | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.40.1
PATCH 1/1 char: ipmi: handle HAS_IOPORT dependencies
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at compile time. We thus need to add this dependency and ifdef sections of code using inb()/outb() as alternative access methods.
---
Note: This patch does not depend any not-yet-mainline HAS_IOPORT changes and may be merged via subsystem specific trees at your earliest convenience.
drivers/char/ipmi/Makefile | 11 ++++------- drivers/char/ipmi/ipmi_si_intf.c | 3 ++- drivers/char/ipmi/ipmi_si_pci.c | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-)
drivers/char/ipmi/Makefile +4 -7
@@ -5,13 +5,10 @@ ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o \ ipmi_si_hotmod.o ipmi_si_hardcode.o ipmi_si_platform.o \ - ipmi_si_port_io.o ipmi_si_mem_io.o -ifdef CONFIG_PCI -ipmi_si-y += ipmi_si_pci.o -endif -ifdef CONFIG_PARISC -ipmi_si-y += ipmi_si_parisc.o -endif + ipmi_si_mem_io.o +ipmi_si-$(CONFIG_HAS_IOPORT) += ipmi_si_port_io.o +ipmi_si-$(CONFIG_PCI) += ipmi_si_pci.o +ipmi_si-$(CONFIG_PARISC) += ipmi_si_parisc.o obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
drivers/char/ipmi/ipmi_si_intf.c +2 -1
@@ -1882,7 +1882,8 @@ int ipmi_si_add_smi(struct si_sm_io *io) }if (!io->io_setup) { -if (io->addr_space ==IPMI_IO_ADDR_SPACE ) { +if (IS_ENABLED (CONFIG_HAS_IOPORT ) && + io->addr_space ==IPMI_IO_ADDR_SPACE ) { io->io_setup = ipmi_si_port_setup; }else if (io->addr_space ==IPMI_MEM_ADDR_SPACE ) { io->io_setup = ipmi_si_mem_setup;
drivers/char/ipmi/ipmi_si_pci.c +3 -0
@@ -97,6 +97,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev, }if (pci_resource_flags (pdev,0 ) &IORESOURCE_IO ) { +if (!IS_ENABLED (CONFIG_HAS_IOPORT )) +return -ENXIO ; + io.addr_space =IPMI_IO_ADDR_SPACE ; io.io_setup = ipmi_si_port_setup; }else {
Signature · 1 line
2.40.1
Quoted 11 lines · Niklas Schnelle
Hi Corey,
This is a follow up in my ongoing effort of making inb()/outb() and similar I/O port accessors compile-time optional. Previously I sent this as a treewide series titled "treewide: Remove I/O port accessors for HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant subset of patches merged I've changed over to per-subsystem series. These series are stand alone and should be merged via the relevant tree such that with all subsystems complete we can follow this up with the final patch that will make the I/O port accessors compile-time optional.
Quoted 5 lines
The current state of the full series with changes to the remaining subsystems and the aforementioned final patch can be found for your convenience on my git.kernel.org tree in the
has_ioport_v6branch[1] with signed tags. As for compile-time vs runtime see Linus' reply to my first attempt[2].
Sorry, my bad, I've been out a lot recently and dealing with a bunch of issues and I missed this.
It's in my tree now and it looks good.
-corey
Quoted 19 lines
Thanks,
Niklas[0] https://lore.kernel.org/all/[email protected]/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=has_ioport_v6
[2] https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/Niklas Schnelle (1):
char: ipmi: handleHAS_IOPORTdependenciesdrivers/char/ipmi/Makefile | 11 ++++------- drivers/char/ipmi/ipmi_si_intf.c | 3 ++- drivers/char/ipmi/ipmi_si_pci.c | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-)Signature · 1 line
2.40.1