Re: [PATCH 2/9] y2038: asm-generic: extend sysvipc data structures

From: Arnd Bergmann
Date: Thu May 21 2015 - 10:52:52 EST


On Thursday 21 May 2015 10:56:34 Geert Uytterhoeven wrote:
> > + * value using
> > + *
> > + * user_semid_ds.sem_otime = kernel_semid64_ds.sem_otime +
> > + * (long long)(kernel_semid64_ds.sem_otime_high << 32)
>
> The cast to "long long" should be inside the parentheses, to promote the
> (32-bit) sem_otime_high to a first 64-bit integer first.
> Else it will be shifted into oblivion (oh no, C undefined behavior).
>
>

Fixed now to say

* user_semid_ds.sem_otime = kernel_semid64_ds.sem_otime +
* ((long long)kernel_semid64_ds.sem_otime_high << 32)

Thanks!

Arnd

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/