From: Jeremy Fitzhardinge Date: Tue, 26 Sep 2006 08:52:39 +0000 (+0200) Subject: [PATCH] Type checking for write_pda() X-Git-Tag: v2.6.19-rc1~1077^2~44 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=85691f135db78f3548107a0abe383dfab3bc38fa;p=~shefty%2Frdma-dev.git [PATCH] Type checking for write_pda() I just added type checking for assignments the PDA in the i386 PDA code. Here's the x86-64 equivalent. (Obviously this doesn't contain the latest x86-64 PDA change.) Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Andi Kleen --- diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index c2aac96ac32..5dadb201f76 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h @@ -49,7 +49,8 @@ extern struct x8664_pda _proxy_pda; #define pda_to_op(op,field,val) do { \ typedef typeof(_proxy_pda.field) T__; \ - switch (sizeof(_proxy_pda.field)) { \ + if (0) { T__ tmp__; tmp__ = (val); } \ + switch (sizeof(_proxy_pda.field)) { \ case 2: \ asm(op "w %1,%%gs:%c2" : "+m" (_proxy_pda.field) : \ "ri" ((T__)val),"i"(pda_offset(field))); break; \