[RESEND PATCH] arm/pgtable: Remove duplicate included header file

Thorsten Blum posted 1 patch 1 year, 1 month ago
There is a newer version of this series
arch/arm/include/asm/pgtable.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[RESEND PATCH] arm/pgtable: Remove duplicate included header file
Posted by Thorsten Blum 1 year, 1 month ago
The header file asm-generic/pgtable-nopud.h is included whether
CONFIG_MMU is defined or not.

Include it only once before the #ifndef/#else/#endif preprocessor
directives and remove the following make includecheck warning:

  asm-generic/pgtable-nopud.h is included more than once

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/arm/include/asm/pgtable.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index be91e376df79..6b986ef6042f 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -19,14 +19,13 @@ extern struct page *empty_zero_page;
 #define ZERO_PAGE(vaddr)	(empty_zero_page)
 #endif
 
-#ifndef CONFIG_MMU
-
 #include <asm-generic/pgtable-nopud.h>
+
+#ifndef CONFIG_MMU
 #include <asm/pgtable-nommu.h>
 
 #else
 
-#include <asm-generic/pgtable-nopud.h>
 #include <asm/page.h>
 #include <asm/pgtable-hwdef.h>
 
-- 
2.47.1
Re: [RESEND PATCH] arm/pgtable: Remove duplicate included header file
Posted by Mike Rapoport 1 year, 1 month ago
On Wed, Dec 25, 2024 at 01:30:35PM +0100, Thorsten Blum wrote:
> The header file asm-generic/pgtable-nopud.h is included whether
> CONFIG_MMU is defined or not.
> 
> Include it only once before the #ifndef/#else/#endif preprocessor
> directives and remove the following make includecheck warning:
> 
>   asm-generic/pgtable-nopud.h is included more than once
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
>  arch/arm/include/asm/pgtable.h | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
> index be91e376df79..6b986ef6042f 100644
> --- a/arch/arm/include/asm/pgtable.h
> +++ b/arch/arm/include/asm/pgtable.h
> @@ -19,14 +19,13 @@ extern struct page *empty_zero_page;
>  #define ZERO_PAGE(vaddr)	(empty_zero_page)
>  #endif
>  
> -#ifndef CONFIG_MMU
> -
>  #include <asm-generic/pgtable-nopud.h>
> +
> +#ifndef CONFIG_MMU
>  #include <asm/pgtable-nommu.h>
>  
>  #else
>  
> -#include <asm-generic/pgtable-nopud.h>
>  #include <asm/page.h>
>  #include <asm/pgtable-hwdef.h>
>  
> -- 
> 2.47.1
> 

-- 
Sincerely yours,
Mike.