diff mbox series

um: define set_pte_at() as a static inline function, not a macro

Message ID 20190313101439.7092-1-brgl@bgdev.pl
State Superseded
Headers show
Series um: define set_pte_at() as a static inline function, not a macro | expand

Commit Message

Bartosz Golaszewski March 13, 2019, 10:14 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

When defined as macro, the mm argument is unused and subsequently the
variable passed as mm is considered unused by the compiler. This fixes
a build warning.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/um/include/asm/pgtable.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven March 13, 2019, 10:30 a.m. UTC | #1
On Wed, Mar 13, 2019 at 11:16 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> When defined as macro, the mm argument is unused and subsequently the
> variable passed as mm is considered unused by the compiler. This fixes
> a build warning.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert
Anton Ivanov March 13, 2019, 4:20 p.m. UTC | #2
On 13/03/2019 10:14, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> When defined as macro, the mm argument is unused and subsequently the
> variable passed as mm is considered unused by the compiler. This fixes
> a build warning.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>   arch/um/include/asm/pgtable.h | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
> index 9c04562310b3..b377df76cc28 100644
> --- a/arch/um/include/asm/pgtable.h
> +++ b/arch/um/include/asm/pgtable.h
> @@ -263,7 +263,12 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval)
>   	*pteptr = pte_mknewpage(*pteptr);
>   	if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr);
>   }
> -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
> +
> +static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
> +			      pte_t *pteptr, pte_t pteval)
> +{
> +	set_pte(pteptr, pteval);
> +}
>   
>   #define __HAVE_ARCH_PTE_SAME
>   static inline int pte_same(pte_t pte_a, pte_t pte_b)
> 
Reviewed-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
diff mbox series

Patch

diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 9c04562310b3..b377df76cc28 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -263,7 +263,12 @@  static inline void set_pte(pte_t *pteptr, pte_t pteval)
 	*pteptr = pte_mknewpage(*pteptr);
 	if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr);
 }
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
+			      pte_t *pteptr, pte_t pteval)
+{
+	set_pte(pteptr, pteval);
+}
 
 #define __HAVE_ARCH_PTE_SAME
 static inline int pte_same(pte_t pte_a, pte_t pte_b)