[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2Qt3AO_FF_J8px9KoCoNGkPrn-+k1aj-xrySb-0wYx0Q@mail.gmail.com>
Date: Mon, 23 Apr 2018 10:48:44 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Finn Thain <fthain@...egraphics.com.au>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Sam Creasey <sammy@...my.net>, linux-m68k@...ts.linux-m68k.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] m68k: Fix off-by-one calendar month
On Mon, Apr 23, 2018 at 3:02 AM, Finn Thain <fthain@...egraphics.com.au> wrote:
> diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
> index 97dd4e26f234..6b4389a6e8ea 100644
> --- a/arch/m68k/kernel/time.c
> +++ b/arch/m68k/kernel/time.c
> @@ -74,17 +74,17 @@ static irqreturn_t timer_interrupt(int irq, void *dummy)
> void read_persistent_clock(struct timespec *ts)
> {
> struct rtc_time time;
> +
> ts->tv_sec = 0;
> ts->tv_nsec = 0;
>
> - if (mach_hwclk) {
> - mach_hwclk(0, &time);
> + if (!mach_hwclk)
> + return;
> +
> + mach_hwclk(0, &time);
>
> - if ((time.tm_year += 1900) < 1970)
> - time.tm_year += 100;
> - ts->tv_sec = mktime(time.tm_year, time.tm_mon, time.tm_mday,
> - time.tm_hour, time.tm_min, time.tm_sec);
> - }
> + ts->tv_sec = mktime(time.tm_year + 1900, time.tm_mon + 1, time.tm_mday,
> + time.tm_hour, time.tm_min, time.tm_sec);
> }
This clashes with a patch I had planned to submit today, but otherwise
looks correct and. I'll respin my patch on top of yours. Since I've taken
a good look at your changes in the meantime
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Arnd
Powered by blists - more mailing lists