On Thu, Jan 03, 2019 at 02:52:15PM +0100, Thomas Huth wrote: > On 2019-01-03 11:08, Janosch Frank wrote: > > +/* > > + * STCKE returns 16 bytes, which include the epoch, tod value and a > > + * programmable field. The value has to be trimmed to be able to work > > + * with it. As there's still some time to 2042, this code is not ready > > + * for multi epoch values. > > + */ > > +static inline void stcke(char *tod) > > +{ > > + asm volatile( > > + " stcke %[tod]\n" > > + : [tod] "=Q" (tod) > > + : : "cc"); > > +} > > I'm not an inline-assembly wizzard, but the "=Q" constraint looks wrong > to me here. Are you sure that this is working as expected? Yes, this is wrong. That's the reason why the kernel variant has the typedef + cast (see get_tod_clock_ext() in arch/s390/include/asm/timex.h). The variant above tells the compiler that only a single byte is written to.