"tsk" is only used when MEMORY_FAILURE=y.

arch/x86/mm/fault.c: In function 'do_sigbus':
arch/x86/mm/fault.c:1017:22: warning: unused variable 'tsk'
[-Wunused-variable]

Signed-off-by: Qian Cai <c...@lca.pw>
---
 arch/x86/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 46df4c6aae46..a10e518dcdf8 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1015,7 +1015,9 @@ static inline bool bad_area_access_from_pkeys(unsigned 
long error_code,
 do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long 
address,
          vm_fault_t fault)
 {
+#ifdef CONFIG_MEMORY_FAILURE
        struct task_struct *tsk = current;
+#endif
 
        /* Kernel mode? Handle exceptions or die: */
        if (!(error_code & X86_PF_USER)) {
-- 
1.8.3.1

Reply via email to