From: Herbert Xu Date: Fri, 7 Jan 2011 03:48:57 +0000 (+1100) Subject: hwrng: via_rng - Fix asm constraints X-Git-Tag: v2.6.38-rc1~238^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0735ac1f2551d9f9d356126aaf3b1110150918e6;p=profile%2Fivi%2Fkernel-x86-ivi.git hwrng: via_rng - Fix asm constraints The inline asm to invoke xstore did not specify the constraints correctly. In particular, dx/di should have been marked as output registers as well as input as they're modified by xstore. Thanks to Mario Holbe for creating this patch and testing it. Tested-by: Mario 'BitKoenig' Holbe Signed-off-by: Herbert Xu --- diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index 794aacb715c..7f86666bb39 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c @@ -81,8 +81,7 @@ static inline u32 xstore(u32 *addr, u32 edx_in) ts_state = irq_ts_save(); asm(".byte 0x0F,0xA7,0xC0 /* xstore %%edi (addr=%0) */" - :"=m"(*addr), "=a"(eax_out) - :"D"(addr), "d"(edx_in)); + : "=m" (*addr), "=a" (eax_out), "+d" (edx_in), "+D" (addr)); irq_ts_restore(ts_state); return eax_out;