From: Jim Bos Date: Sat, 13 Nov 2010 11:13:53 +0000 (+0100) Subject: i8k: Tell gcc that *regs gets clobbered X-Git-Tag: v2.6.35.14~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e58c04b185972bebd832a9716a037aa1c5fab745;p=thirdparty%2Fkernel%2Fstable.git i8k: Tell gcc that *regs gets clobbered [ upstream commit 6b4e81db2552bad04100e7d5ddeed7e848f53b48 ] More recent GCC caused the i8k driver to stop working, on Slackware compiler was upgraded from gcc-4.4.4 to gcc-4.5.1 after which it didn't work anymore, meaning the driver didn't load or gave total nonsensical output. As it turned out the asm(..) statement forgot to mention it modifies the *regs variable. Credits to Andi Kleen and Andreas Schwab for providing the fix. Signed-off-by: Jim Bos Cc: Andi Kleen Cc: Andreas Schwab Signed-off-by: Linus Torvalds Signed-off-by: Andi Kleen --- diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index 4cd8b227c11f3..0add4a667e933 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c @@ -141,7 +141,7 @@ static int i8k_smm(struct smm_regs *regs) "lahf\n\t" "shrl $8,%%eax\n\t" "andl $1,%%eax\n" - :"=a"(rc) + :"=a"(rc), "+m" (*regs) : "a"(regs) : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); #else @@ -166,7 +166,8 @@ static int i8k_smm(struct smm_regs *regs) "movl %%edx,0(%%eax)\n\t" "lahf\n\t" "shrl $8,%%eax\n\t" - "andl $1,%%eax\n":"=a"(rc) + "andl $1,%%eax\n" + :"=a"(rc), "+m" (*regs) : "a"(regs) : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); #endif