On Wed, Jun 20, 2018 at 9:55 PM, Arnd Bergmann arnd@arndb.de wrote:
On Wed, Jun 20, 2018 at 6:55 PM, Viacheslav Dubeyko slava@dubeyko.com wrote:
On Tue, 2018-06-19 at 21:42 +0200, Arnd Bergmann wrote:
On Tue, Jun 19, 2018 at 7:03 PM, Viacheslav Dubeyko slava@dubeyko.com wrote:
/* time macros: convert between 1904-2040 and 1970-2106 range,
- pre-1970 timestamps are interpreted as post-2038 times after
wrap-around */ -#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) +#define __hfsp_mt2ut(t) ((time64_t)be32_to_cpu(t) - 2082844800U) #define __hfsp_ut2mt(t) (cpu_to_be32(t + 2082844800U))
/* compatibility */
I can submit that separately so that it can get backported into stable kernels if you like, with the type changes as a follow-up on top.
Sounds good.
Ok, I'll send an updated version with that patch first then.
I've now sent that patch with additional information that I got from reading the XNU sources. Interestingly, that also uses the 1970-2106 time range that I had in my original series, not the 1904-2040 time range that is documented.
Arnd