All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: fix variable 'pud' set but not used
@ 2019-07-31 20:05 ` Qian Cai
  0 siblings, 0 replies; 4+ messages in thread
From: Qian Cai @ 2019-07-31 20:05 UTC (permalink / raw)
  To: catalin.marinas; +Cc: will, linux-arm-kernel, linux-kernel, Qian Cai

GCC throws a warning,

arch/arm64/mm/mmu.c: In function 'pud_free_pmd_page':
arch/arm64/mm/mmu.c:1033:8: warning: variable 'pud' set but not used
[-Wunused-but-set-variable]
  pud_t pud;
        ^~~

because pud_table() is a macro and compiled away. Fix it by making it a
static inline function and for pud_sect() as well.

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/arm64/include/asm/pgtable.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 3f5461f7b560..541cb4a15341 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -447,8 +447,15 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				 PMD_TYPE_SECT)
 
 #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
-#define pud_sect(pud)		(0)
-#define pud_table(pud)		(1)
+static inline bool pud_sect(pud_t pud)
+{
+	return false;
+}
+
+static inline bool pud_table(pud_t pud)
+{
+	return true;
+}
 #else
 #define pud_sect(pud)		((pud_val(pud) & PUD_TYPE_MASK) == \
 				 PUD_TYPE_SECT)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm64/mm: fix variable 'pud' set but not used
@ 2019-07-31 20:05 ` Qian Cai
  0 siblings, 0 replies; 4+ messages in thread
From: Qian Cai @ 2019-07-31 20:05 UTC (permalink / raw)
  To: catalin.marinas; +Cc: Qian Cai, will, linux-kernel, linux-arm-kernel

GCC throws a warning,

arch/arm64/mm/mmu.c: In function 'pud_free_pmd_page':
arch/arm64/mm/mmu.c:1033:8: warning: variable 'pud' set but not used
[-Wunused-but-set-variable]
  pud_t pud;
        ^~~

because pud_table() is a macro and compiled away. Fix it by making it a
static inline function and for pud_sect() as well.

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/arm64/include/asm/pgtable.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 3f5461f7b560..541cb4a15341 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -447,8 +447,15 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				 PMD_TYPE_SECT)
 
 #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
-#define pud_sect(pud)		(0)
-#define pud_table(pud)		(1)
+static inline bool pud_sect(pud_t pud)
+{
+	return false;
+}
+
+static inline bool pud_table(pud_t pud)
+{
+	return true;
+}
 #else
 #define pud_sect(pud)		((pud_val(pud) & PUD_TYPE_MASK) == \
 				 PUD_TYPE_SECT)
-- 
1.8.3.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64/mm: fix variable 'pud' set but not used
  2019-07-31 20:05 ` Qian Cai
@ 2019-08-01 12:04   ` Will Deacon
  -1 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2019-08-01 12:04 UTC (permalink / raw)
  To: Qian Cai; +Cc: catalin.marinas, linux-arm-kernel, linux-kernel

On Wed, Jul 31, 2019 at 04:05:45PM -0400, Qian Cai wrote:
> GCC throws a warning,
> 
> arch/arm64/mm/mmu.c: In function 'pud_free_pmd_page':
> arch/arm64/mm/mmu.c:1033:8: warning: variable 'pud' set but not used
> [-Wunused-but-set-variable]
>   pud_t pud;
>         ^~~
> 
> because pud_table() is a macro and compiled away. Fix it by making it a
> static inline function and for pud_sect() as well.
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/arm64/include/asm/pgtable.h | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index 3f5461f7b560..541cb4a15341 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -447,8 +447,15 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
>  				 PMD_TYPE_SECT)
>  
>  #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
> -#define pud_sect(pud)		(0)
> -#define pud_table(pud)		(1)
> +static inline bool pud_sect(pud_t pud)
> +{
> +	return false;
> +}
> +
> +static inline bool pud_table(pud_t pud)
> +{
> +	return true;
> +}

Applied for 5.3.

Will

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64/mm: fix variable 'pud' set but not used
@ 2019-08-01 12:04   ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2019-08-01 12:04 UTC (permalink / raw)
  To: Qian Cai; +Cc: catalin.marinas, linux-kernel, linux-arm-kernel

On Wed, Jul 31, 2019 at 04:05:45PM -0400, Qian Cai wrote:
> GCC throws a warning,
> 
> arch/arm64/mm/mmu.c: In function 'pud_free_pmd_page':
> arch/arm64/mm/mmu.c:1033:8: warning: variable 'pud' set but not used
> [-Wunused-but-set-variable]
>   pud_t pud;
>         ^~~
> 
> because pud_table() is a macro and compiled away. Fix it by making it a
> static inline function and for pud_sect() as well.
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/arm64/include/asm/pgtable.h | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index 3f5461f7b560..541cb4a15341 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -447,8 +447,15 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
>  				 PMD_TYPE_SECT)
>  
>  #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
> -#define pud_sect(pud)		(0)
> -#define pud_table(pud)		(1)
> +static inline bool pud_sect(pud_t pud)
> +{
> +	return false;
> +}
> +
> +static inline bool pud_table(pud_t pud)
> +{
> +	return true;
> +}

Applied for 5.3.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-01 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 20:05 [PATCH] arm64/mm: fix variable 'pud' set but not used Qian Cai
2019-07-31 20:05 ` Qian Cai
2019-08-01 12:04 ` Will Deacon
2019-08-01 12:04   ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.