linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault()
@ 2023-07-04  1:00 SeongJae Park
  2023-07-04  1:48 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: SeongJae Park @ 2023-07-04  1:00 UTC (permalink / raw)
  To: akpm
  Cc: surenb, Liam.Howlett, torvalds, catalin.marinas, will, linux-mm,
	linux-arm-kernel, linux-kernel, SeongJae Park

Commit ae870a68b5d1 ("arm64/mm: Convert to using
lock_mm_and_find_vma()") made do_page_fault() to use 'vma' even if
CONFIG_PER_VMA_LOCK is not defined, but the declaration is still in the
ifdef.  As a result, building kernel without the config fails with
undeclared variable error as below:

    arch/arm64/mm/fault.c: In function 'do_page_fault':
    arch/arm64/mm/fault.c:624:2: error: 'vma' undeclared (first use in this function); did you mean 'vmap'?
      624 |  vma = lock_mm_and_find_vma(mm, addr, regs);
          |  ^~~
          |  vmap

Fix it by moving the declaration out of the ifdef.

Fixes: ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 arch/arm64/mm/fault.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 9d78ff78b0e3..b8c80f7b8a5f 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -536,9 +536,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr,
 	unsigned long vm_flags;
 	unsigned int mm_flags = FAULT_FLAG_DEFAULT;
 	unsigned long addr = untagged_addr(far);
-#ifdef CONFIG_PER_VMA_LOCK
 	struct vm_area_struct *vma;
-#endif
 
 	if (kprobe_page_fault(regs, esr))
 		return 0;
-- 
2.25.1



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

* Re: [PATCH] arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault()
  2023-07-04  1:00 [PATCH] arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() SeongJae Park
@ 2023-07-04  1:48 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2023-07-04  1:48 UTC (permalink / raw)
  To: SeongJae Park
  Cc: akpm, surenb, Liam.Howlett, catalin.marinas, will, linux-mm,
	linux-arm-kernel, linux-kernel

On Mon, 3 Jul 2023 at 18:00, SeongJae Park <sj@kernel.org> wrote:
>
> Commit ae870a68b5d1 ("arm64/mm: Convert to using
> lock_mm_and_find_vma()") made do_page_fault() to use 'vma' even if
> CONFIG_PER_VMA_LOCK is not defined, but the declaration is still in the
> ifdef.

Duh. Thanks. Applied.

              Linus


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

end of thread, other threads:[~2023-07-04  1:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04  1:00 [PATCH] arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() SeongJae Park
2023-07-04  1:48 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox