s390/time: fix get_tod_clock_ext inline assembly
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 28 Oct 2013 10:17:10 +0000 (11:17 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 31 Oct 2013 08:52:48 +0000 (09:52 +0100)
The get_tod_clock_ext inline assembly does not specify its output
operands correctly. This can cause incorrect code to be generated.

Cc: stable@vger.kernel.org # 3.12
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/timex.h

index 819b94d2272054d318fdd12c31b8718a9e4bb0bd..8beee1cceba4ed17831736a11c6f5167155335d6 100644 (file)
@@ -71,9 +71,11 @@ static inline void local_tick_enable(unsigned long long comp)
 
 typedef unsigned long long cycles_t;
 
-static inline void get_tod_clock_ext(char *clk)
+static inline void get_tod_clock_ext(char clk[16])
 {
-       asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
+       typedef struct { char _[sizeof(clk)]; } addrtype;
+
+       asm volatile("stcke %0" : "=Q" (*(addrtype *) clk) : : "cc");
 }
 
 static inline unsigned long long get_tod_clock(void)
This page took 0.024844 seconds and 5 git commands to generate.