diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index ba3c523aaf16..3b0e413670e4 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -99,7 +99,7 @@ do { \ case 1: \ asm(op "b %1,"__percpu_arg(0) \ : "+m" (var) \ - : "qi" ((pto_T__)(val))); \ + : "qi" ((unsigned char)(unsigned long)(val))); \ break; \ case 2: \ asm(op "w %1,"__percpu_arg(0) \ @@ -144,7 +144,7 @@ do { \ else \ asm("addb %1, "__percpu_arg(0) \ : "+m" (var) \ - : "qi" ((pao_T__)(val))); \ + : "qi" ((unsigned char)(unsigned long)(val))); \ break; \ case 2: \ if (pao_ID__ == 1) \ @@ -182,12 +182,14 @@ do { \ #define percpu_from_op(op, var) \ ({ \ + unsigned char pfo_u8__; \ typeof(var) pfo_ret__; \ switch (sizeof(var)) { \ case 1: \ asm(op "b "__percpu_arg(1)",%0" \ - : "=q" (pfo_ret__) \ + : "=q" (pfo_u8__) \ : "m" (var)); \ + pfo_ret__ = (typeof(var))(unsigned long)pfo_u8__; \ break; \ case 2: \ asm(op "w "__percpu_arg(1)",%0" \ @@ -211,12 +213,14 @@ do { \ #define percpu_stable_op(op, var) \ ({ \ + unsigned char pfo_u8__; \ typeof(var) pfo_ret__; \ switch (sizeof(var)) { \ case 1: \ asm(op "b "__percpu_arg(P1)",%0" \ - : "=q" (pfo_ret__) \ + : "=q" (pfo_u8__) \ : "p" (&(var))); \ + pfo_ret__ = (typeof(var))(unsigned long)pfo_u8__; \ break; \ case 2: \ asm(op "w "__percpu_arg(P1)",%0" \