[PATCH] memblock: Remove unused io.h include

Karolina Drobnik posted 1 patch 4 years, 4 months ago
mm/memblock.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] memblock: Remove unused io.h include
Posted by Karolina Drobnik 4 years, 4 months ago
Memblock does not use anything from io.h, remove the include.

Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 mm/memblock.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 1018e50566f3..4ee190b3f026 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -18,7 +18,6 @@
 #include <linux/memblock.h>
 
 #include <asm/sections.h>
-#include <linux/io.h>
 
 #include "internal.h"
 
-- 
2.30.2

Re: [PATCH] memblock: Remove unused io.h include
Posted by Mike Rapoport 4 years, 4 months ago
Hi Karolina,

On Mon, Jan 31, 2022 at 01:17:23PM +0100, Karolina Drobnik wrote:
> 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/YfbQlMyohx31FhSW@casper.infradead.org/
 
> Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
> ---
>  mm/memblock.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 1018e50566f3..4ee190b3f026 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -18,7 +18,6 @@
>  #include <linux/memblock.h>
>  
>  #include <asm/sections.h>
> -#include <linux/io.h>
>  
>  #include "internal.h"
>  
> -- 
> 2.30.2
> 

-- 
Sincerely yours,
Mike.
Re: [PATCH] memblock: Remove unused io.h include
Posted by Karolina Drobnik 4 years, 4 months ago
Hi Mike,

Thanks for taking a look at my patch.

On Tue, 2022-02-01 at 17:26 +0200, Mike Rapoport wrote:
> 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.

OK, will leave it as it is then.


Many thanks,
Karolina

Re: [PATCH] memblock: Remove unused io.h include
Posted by Christoph Hellwig 4 years, 4 months ago
On Mon, Jan 31, 2022 at 01:17:23PM +0100, Karolina Drobnik wrote:
> Memblock does not use anything from io.h, remove the include.
> 
> Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>