提交 318759b4 编写于 作者: E Eric W. Biederman

signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus

Stephen Rothwell <sfr@canb.auug.org.au> reported:
> After merging the userns tree, today's linux-next build (i386 defconfig)
> produced this warning:
>
> arch/x86/mm/fault.c: In function 'do_sigbus':
> arch/x86/mm/fault.c:1017:22: warning: unused variable 'tsk' [-Wunused-variable]
>   struct task_struct *tsk = current;
>                       ^~~
>
> Introduced by commit
>
>   351b6825 ("signal: Explicitly call force_sig_fault on current")
>
> The remaining used of "tsk" are protected by CONFIG_MEMORY_FAILURE.

So do the obvious thing and move tsk inside of CONFIG_MEMORY_FAILURE
to prevent introducing new warnings into the build.
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
上级 a89e9b8a
...@@ -1014,8 +1014,6 @@ static void ...@@ -1014,8 +1014,6 @@ static void
do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
vm_fault_t fault) vm_fault_t fault)
{ {
struct task_struct *tsk = current;
/* Kernel mode? Handle exceptions or die: */ /* Kernel mode? Handle exceptions or die: */
if (!(error_code & X86_PF_USER)) { if (!(error_code & X86_PF_USER)) {
no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
...@@ -1030,6 +1028,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, ...@@ -1030,6 +1028,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
#ifdef CONFIG_MEMORY_FAILURE #ifdef CONFIG_MEMORY_FAILURE
if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
struct task_struct *tsk = current;
unsigned lsb = 0; unsigned lsb = 0;
pr_err( pr_err(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册