Thread (23 messages) 23 messages, 7 authors, 2018-07-23

Re: [PATCH 2/3] [v2] m68k: mac: use time64_t in RTC handling

From: Arnd Bergmann <arnd@arndb.de>
Date: 2018-07-18 14:26:21
Also in: lkml

On Wed, Jul 18, 2018 at 3:49 PM, Finn Thain [off-list ref] wrote:
On Wed, 18 Jul 2018, Arnd Bergmann wrote:
quoted
-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.
quoted
        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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help