mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/mm: fix an unused variable "tsk" warning
@ 2019-05-31 20:38 Qian Cai
  2019-05-31 20:53 ` Dave Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-05-31 20:38 UTC (permalink / raw)
  To: mingo, tglx, bp
  Cc: dave.hansen, luto, peterz, hpa, x86, linux-kernel, Qian Cai

"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 <cai@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


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

end of thread, other threads:[~2019-05-31 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 20:38 [PATCH] x86/mm: fix an unused variable "tsk" warning Qian Cai
2019-05-31 20:53 ` Dave Hansen

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

all inboxes | Powered by JetHome®