Commit dd2994f6 authored by Andi Kleen's avatar Andi Kleen Committed by Andi Kleen

[PATCH] Add sparse annotations to quiet sparse in arch/x86_64/mm/fault.c

Fixes

linux/arch/x86_64/mm/fault.c:125:7: warning: incorrect type in argument 1 (different address spaces)
linux/arch/x86_64/mm/fault.c:125:7:    expected void [noderef] *<noident><asn:1>
linux/arch/x86_64/mm/fault.c:125:7:    got unsigned char *[assigned] instr
linux/arch/x86_64/mm/fault.c:163:8: warning: incorrect type in argument 1 (different address spaces)
linux/arch/x86_64/mm/fault.c:163:8:    expected void [noderef] *<noident><asn:1>
linux/arch/x86_64/mm/fault.c:163:8:    got unsigned char *[assigned] instr
linux/arch/x86_64/mm/fault.c:179:9: warning: incorrect type in argument 1 (different address spaces)
linux/arch/x86_64/mm/fault.c:179:9:    expected void [noderef] *<noident><asn:1>
linux/arch/x86_64/mm/fault.c:179:9:    got unsigned long *<noident>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent 131cfd7b
...@@ -102,7 +102,7 @@ void bust_spinlocks(int yes) ...@@ -102,7 +102,7 @@ void bust_spinlocks(int yes)
static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr, static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned long error_code) unsigned long error_code)
{ {
unsigned char *instr; unsigned char __user *instr;
int scan_more = 1; int scan_more = 1;
int prefetch = 0; int prefetch = 0;
unsigned char *max_instr; unsigned char *max_instr;
...@@ -111,7 +111,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr, ...@@ -111,7 +111,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
if (error_code & PF_INSTR) if (error_code & PF_INSTR)
return 0; return 0;
instr = (unsigned char *)convert_rip_to_linear(current, regs); instr = (unsigned char __user *)convert_rip_to_linear(current, regs);
max_instr = instr + 15; max_instr = instr + 15;
if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE) if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE)
...@@ -122,7 +122,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr, ...@@ -122,7 +122,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned char instr_hi; unsigned char instr_hi;
unsigned char instr_lo; unsigned char instr_lo;
if (__get_user(opcode, instr)) if (__get_user(opcode, (char __user *)instr))
break; break;
instr_hi = opcode & 0xf0; instr_hi = opcode & 0xf0;
...@@ -160,7 +160,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr, ...@@ -160,7 +160,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
case 0x00: case 0x00:
/* Prefetch instruction is 0x0F0D or 0x0F18 */ /* Prefetch instruction is 0x0F0D or 0x0F18 */
scan_more = 0; scan_more = 0;
if (__get_user(opcode, instr)) if (__get_user(opcode, (char __user *)instr))
break; break;
prefetch = (instr_lo == 0xF) && prefetch = (instr_lo == 0xF) &&
(opcode == 0x0D || opcode == 0x18); (opcode == 0x0D || opcode == 0x18);
...@@ -176,7 +176,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr, ...@@ -176,7 +176,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
static int bad_address(void *p) static int bad_address(void *p)
{ {
unsigned long dummy; unsigned long dummy;
return __get_user(dummy, (unsigned long *)p); return __get_user(dummy, (unsigned long __user *)p);
} }
void dump_pagetable(unsigned long address) void dump_pagetable(unsigned long address)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment