Skip to contentSkip to conversation

PCI: hotplug: Drop superfluous #include directives

PATCH Applied Lukas Wunner 2 participants 4 messages Apr 14, 2025 – Apr 17, 2025 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: hotplug: Drop superfluous #include directives

In February 2003, historic commit

https://git.kernel.org/tglx/history/c/280c1c9a0ea4
("[PATCH] PCI Hotplug: Replace pcihpfs with sysfs.")

removed all invocations of __get_free_page() and free_page() from the PCI hotplug core without also removing the #include <linux/pagemap.h> directive.

It removed all invocations of kern_mount(), mntget() and mntput() without also removing the #include <linux/mount.h> directive.

It removed all invocations of lookup_hash()
without also removing the #include <linux/namei.h> directive.

It removed all invocations of copy_to_user() and copy_from_user() without also removing the #include <linux/uaccess.h> directive.

These #include directives are still unnecessary today, so drop them.

---
 drivers/pci/hotplug/pci_hotplug_core.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/pci/hotplug/pci_hotplug_core.c +0 -4
index d8c5856..210f93d 100644
@@ -20,13 +20,9 @@
 #include <linux/types.h>
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
-#include <linux/pagemap.h>
 #include <linux/init.h>
-#include <linux/mount.h>
-#include <linux/namei.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
-#include <linux/uaccess.h>
 #include "../pci.h"
 #include "cpci_hotplug.h"
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 15 lines · Lukas Wunner

In February 2003, historic commit

https://git.kernel.org/tglx/history/c/280c1c9a0ea4
("[PATCH] PCI Hotplug: Replace pcihpfs with sysfs.")

removed all invocations of __get_free_page() and free_page() from the PCI hotplug core without also removing the #include <linux/pagemap.h> directive.

It removed all invocations of kern_mount(), mntget() and mntput() without also removing the #include <linux/mount.h> directive.

It removed all invocations of lookup_hash()
without also removing the #include <linux/namei.h> directive.

Quoted 6 lines

It removed all invocations of copy_to_user() and copy_from_user() without also removing the #include <linux/uaccess.h> directive.

These #include directives are still unnecessary today, so drop them.

Applied to pci/hotplug for v6.16, thanks!

Quoted 25 lines
---
 drivers/pci/hotplug/pci_hotplug_core.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/pci/hotplug/pci_hotplug_core.c +0 -4
index d8c5856..210f93d 100644
@@ -20,13 +20,9 @@
 #include <linux/types.h>
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
-#include <linux/pagemap.h>
 #include <linux/init.h>
-#include <linux/mount.h>
-#include <linux/namei.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
-#include <linux/uaccess.h>
 #include "../pci.h"
 #include "cpci_hotplug.h"
 
Signature · 1 line
2.43.0
#2 lore raw
Quoted 16 lines · Bjorn Helgaas
Quoted 15 lines · Lukas Wunner

In February 2003, historic commit

https://git.kernel.org/tglx/history/c/280c1c9a0ea4
("[PATCH] PCI Hotplug: Replace pcihpfs with sysfs.")

removed all invocations of __get_free_page() and free_page() from the PCI hotplug core without also removing the #include <linux/pagemap.h> directive.

It removed all invocations of kern_mount(), mntget() and mntput() without also removing the #include <linux/mount.h> directive.

It removed all invocations of lookup_hash()
without also removing the #include <linux/namei.h> directive.

Quoted 8 lines
Quoted 6 lines

It removed all invocations of copy_to_user() and copy_from_user() without also removing the #include <linux/uaccess.h> directive.

These #include directives are still unnecessary today, so drop them.

Applied to pci/hotplug for v6.16, thanks!

A small issue snuck into the commit message while applying:

There's a sentence which ends abruptly:

It removed all invocations of lookup_hash() without also removing the

The remainder of the sentence should have been:

    #include <linux/namei.h> directive.

While rewrapping the paragraph, the word "#ifdef" ended up at the beginning of the line and "git commit" interpreted that as a comment and stripped the line from the commit message.

I think just prepending a blank to the line may stop git from doing that.

Thanks,

Lukas

#3 lore raw
Quoted 32 lines · Lukas Wunner
Quoted 16 lines · Bjorn Helgaas
Quoted 15 lines · Lukas Wunner

In February 2003, historic commit

https://git.kernel.org/tglx/history/c/280c1c9a0ea4
("[PATCH] PCI Hotplug: Replace pcihpfs with sysfs.")

removed all invocations of __get_free_page() and free_page() from the PCI hotplug core without also removing the #include <linux/pagemap.h> directive.

It removed all invocations of kern_mount(), mntget() and mntput() without also removing the #include <linux/mount.h> directive.

It removed all invocations of lookup_hash()
without also removing the #include <linux/namei.h> directive.

Quoted 8 lines
Quoted 6 lines

It removed all invocations of copy_to_user() and copy_from_user() without also removing the #include <linux/uaccess.h> directive.

These #include directives are still unnecessary today, so drop them.

Applied to pci/hotplug for v6.16, thanks!

A small issue snuck into the commit message while applying:

There's a sentence which ends abruptly:

It removed all invocations of lookup_hash() without also removing the

Quoted 7 lines

The remainder of the sentence should have been:

    #include <linux/namei.h> directive.

While rewrapping the paragraph, the word "#ifdef" ended up at the beginning of the line and "git commit" interpreted that as a comment and stripped the line from the commit message.

Wow, thanks for noticing that. That's new to me. I this I restored it.