* [PATCH] um: define set_pte_at() as a static inline function, not a macro
@ 2019-03-13 10:14 Bartosz Golaszewski
2019-03-13 10:30 ` Geert Uytterhoeven
2019-03-13 16:20 ` Anton Ivanov
0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2019-03-13 10:14 UTC (permalink / raw)
To: Jeff Dike, Richard Weinberger, Anton Ivanov
Cc: linux-um, linux-kernel, Bartosz Golaszewski
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)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] um: define set_pte_at() as a static inline function, not a macro
2019-03-13 10:14 [PATCH] um: define set_pte_at() as a static inline function, not a macro Bartosz Golaszewski
@ 2019-03-13 10:30 ` Geert Uytterhoeven
2019-03-13 16:20 ` Anton Ivanov
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2019-03-13 10:30 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Jeff Dike, Richard Weinberger, Anton Ivanov, linux-um,
Linux Kernel Mailing List, Bartosz Golaszewski
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
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] um: define set_pte_at() as a static inline function, not a macro
2019-03-13 10:14 [PATCH] um: define set_pte_at() as a static inline function, not a macro Bartosz Golaszewski
2019-03-13 10:30 ` Geert Uytterhoeven
@ 2019-03-13 16:20 ` Anton Ivanov
1 sibling, 0 replies; 3+ messages in thread
From: Anton Ivanov @ 2019-03-13 16:20 UTC (permalink / raw)
To: Bartosz Golaszewski, Jeff Dike, Richard Weinberger
Cc: Bartosz Golaszewski, linux-um, linux-kernel
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>
--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-13 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13 10:14 [PATCH] um: define set_pte_at() as a static inline function, not a macro Bartosz Golaszewski
2019-03-13 10:30 ` Geert Uytterhoeven
2019-03-13 16:20 ` Anton Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).