Skip to contentSkip to conversation

memblock: Remove unused io.h include

PATCH In review Karolina Drobnik 3 participants 4 messages Jan 31, 2022 – Feb 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memblock: Remove unused io.h include

Memblock does not use anything from io.h, remove the include.

---
 mm/memblock.c | 1 -
 1 file changed, 1 deletion(-)
mm/memblock.c +0 -1
index 1018e50566f3..4ee190b3f026 100644
@@ -18,7 +18,6 @@
 #include <linux/memblock.h>
 
 #include <asm/sections.h>
-#include <linux/io.h>
 
 #include "internal.h"
 
Signature · 1 line
2.30.2
maintainer
#1 lore raw

Hi Karolina,

Quoted 1 line · Karolina Drobnik

Memblock does not use anything from io.h, remove the include.

As Matthew pointed out [1], many architectures put their definition of virt_to_phys() in asm/io.h, e.g.

arch/powerpc/include/asm/io.h:#define virt_to_phys virt_to_phys arch/sh/include/asm/io.h:#define virt_to_phys(address) ((unsigned long)(address)) arch/x86/include/asm/io.h:#define virt_to_phys virt_to_phys

which means memblock needs this header for declaration of virt_to_phys().

Although it is included indirectly, let's keep it for now.

[1] https://lore.kernel.org/all/[email protected]/

Quoted 21 lines
---
 mm/memblock.c | 1 -
 1 file changed, 1 deletion(-)
mm/memblock.c +0 -1
index 1018e50566f3..4ee190b3f026 100644
@@ -18,7 +18,6 @@
 #include <linux/memblock.h>
 
 #include <asm/sections.h>
-#include <linux/io.h>
 
 #include "internal.h"
 
Signature · 1 line
2.30.2
Signature · 2 lines
Sincerely yours,
Mike.
#2 lore raw

Hi Mike,

Thanks for taking a look at my patch.

Quoted 8 lines · Mike Rapoport

As Matthew pointed out [1], many architectures put their definition of virt_to_phys() in asm/io.h, e.g.

arch/powerpc/include/asm/io.h:#define virt_to_phys virt_to_phys arch/sh/include/asm/io.h:#define virt_to_phys(address)  ((unsigned long)(address))
arch/x86/include/asm/io.h:#define virt_to_phys virt_to_phys

Quoted 4 lines

which means memblock needs this header for declaration of virt_to_phys().

Although it is included indirectly, let's keep it for now.

OK, will leave it as it is then.

Many thanks,
Karolina