[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3azDB5WsQWTKOSmXNqycTxz0qXtowS61_=zUsnMo+EXg@mail.gmail.com>
Date: Wed, 18 Jul 2018 16:26:16 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Finn Thain <fthain@...egraphics.com.au>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Joshua Thompson <funaho@...ai.org>,
Mathieu Malaterre <malat@...ian.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Greg Ungerer <gerg@...ux-m68k.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
Meelis Roos <mroos@...ux.ee>,
Andreas Schwab <schwab@...ux-m68k.org>
Subject: Re: [PATCH 2/3] [v2] m68k: mac: use time64_t in RTC handling
On Wed, Jul 18, 2018 at 3:49 PM, Finn Thain <fthain@...egraphics.com.au> wrote:
> On Wed, 18 Jul 2018, Arnd Bergmann wrote:
>>
>> -static long via_read_time(void)
>> +static time64_t via_read_time(void)
>> {
>> union {
>> __u8 cdata[4];
>> - long idata;
>> + __u32 idata;
>> } result, last_result;
>> + time64_t ret;
>
> ret isn't used.
>
>> int count = 1;
>>
>> via_pram_command(0x81, &last_result.cdata[3]);
>> @@ -279,12 +280,8 @@ static long via_read_time(void)
>> via_pram_command(0x89, &result.cdata[1]);
>> via_pram_command(0x8D, &result.cdata[0]);
>>
>> - if (result.idata == last_result.idata) {
>> - if (result.idata < RTC_OFFSET)
>> - result.idata += 0x100000000ull;
>> -
>> - return result.idata - RTC_OFFSET;
>> - }
>> + if (result.idata == last_result.idata)
>> + return (time64_t(result.idata) - RTC_OFFSET);
>>
>
> Did you mean to write,
>
> return (time64_t)result.idata - RTC_OFFSET;
>
> ?
Right, I should have at least tried to build it again.
Arnd
Powered by blists - more mailing lists