Skip to content

Commit

Permalink
s390/time: fix get_tod_clock_ext inline assembly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Schwidefsky committed Oct 31, 2013
1 parent ac526f4 commit 7ab64a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/s390/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ab64a8

Please sign in to comment.