[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2LxZND3bg5dCaS4OgQv+fxZ3q6Fd8kUwkC1vhwhr-C-g@mail.gmail.com>
Date: Tue, 24 Apr 2018 14:54:15 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Finn Thain <fthain@...egraphics.com.au>,
Sam Creasey <sammy@...my.net>,
linux-m68k <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 Tue, Apr 24, 2018 at 12:37 PM, Alexandre Belloni
<alexandre.belloni@...tlin.com> wrote:
> On 24/04/2018 12:06:30+0200, Geert Uytterhoeven wrote:
>>
>> On Mon, Apr 23, 2018 at 3:02 AM, Finn Thain <fthain@...egraphics.com.au> wrote:
>> <snip>
>>
>> > --- 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;
>
> Note that this change may break existing users.
I had the same thought but then realized that the +=100 logic was simply
moved into the individual drivers, so the behavior should not change here.
> I'm perfectly fine with
> it as doing this is generally wrong anyway and this is something I'd
> like to see eliminated.
I think most of the m68k RTC hardware uses two-digit BCD year numbers,
so we can't just remove it without implementing something else to
lift the RTC into the current century.
Arnd
Powered by blists - more mailing lists