]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
watchdog: hpwdt: fix use of inline assembly
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 Jun 2008 19:19:28 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Jun 2008 21:08:30 +0000 (14:08 -0700)
commite5e3a8f78823da1e66b75f7bcc28626589fb650c
treeef2ee5ad424c828a996f753aa01736ea36b483ba
parent14e2b0d02fb9ebd54166c1d76c3eeb15c00524c2
watchdog: hpwdt: fix use of inline assembly

commit 1f6ef2342972dc7fd623f360f84006e2304eb935 upstream

The inline assembly in drivers/watchdog/hpwdt.c was incredibly broken,
and included all the function prologue and epilogue stuff, even though
it was itself then inside a C function where the compiler would add its
own prologue and epilogue on top of it all.

This then just _happened_ to work if you had exactly the right compiler
version and exactly the right compiler flags, so that gcc just happened
to not create any prologue at all (the gcc-generated epilogue wouldn't
matter, since it would never be reached).

But the more proper way to fix it is to simply not do this.  Move the
inline asm to the top level, with no surrounding function at all (the
better alternative would be to remove the prologue and make it actually
use proper description of the arguments to the inline asm, but that's a
bigger change than the one I'm willing to make right now).

Tested-by: S.Çağlar Onur <caglar@pardus.org.tr>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/watchdog/hpwdt.c