All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	James Hogan <jhogan@kernel.org>,
	chenhc@lemote.com, Kate Stewart <kstewart@linuxfoundation.org>,
	gregkh <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Mark Brown <broonie@kernel.org>,
	Paul Burton <paul.burton@mips.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"open list:RALINK MIPS ARCHITECTURE" <linux-mips@linux-mips.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] MIPS: Convert update_persistent_clock() to update_persistent_clock64()
Date: Fri, 4 May 2018 14:23:13 +0800	[thread overview]
Message-ID: <CAMz4ku+WbtBGGcmsYmMexxcBTJONHF3J-T8Sxo7wgHoZZCVt1w@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a3TJ-5+22_CSYjdtL3pXEVHC7t_KzaOX6PG4X_1R1bMxQ@mail.gmail.com>

On 4 May 2018 at 06:31, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wed, May 2, 2018 at 10:53 PM, Baolin Wang <baolin.wang@linaro.org> wrote:
>> diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h
>> index 17d4cd2..c4e2a1a 100644
>> --- a/arch/mips/include/asm/time.h
>> +++ b/arch/mips/include/asm/time.h
>> @@ -27,8 +27,8 @@
>>   *     rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need
>>   *                     to be set.  Used by RTC sync-up.
>>   */
>> -extern int rtc_mips_set_time(unsigned long);
>> -extern int rtc_mips_set_mmss(unsigned long);
>> +extern int rtc_mips_set_time(time64_t);
>> +extern int rtc_mips_set_mmss(time64_t);
>>
>
> I think these should just get removed, and each implementation replaced
> with a direct update_persistent_clock64() function.

I thought this was one minor modification that will reduce the risk of
introducing other issues, but as you suggested we can do some complete
cleanup by removing set_mmss/set_time. OK, I will do that.

>
>> -int update_persistent_clock(struct timespec now)
>> +int update_persistent_clock64(struct timespec64 now)
>>  {
>>         return rtc_mips_set_mmss(now.tv_sec);
>>  }
>
> And this one also removed

Sure.

>
>> @@ -69,7 +69,7 @@ int proc_dolasatrtc(struct ctl_table *table, int write,
>>                 if (rtctmp < 0)
>>                         rtctmp = 0;
>>         }
>> -       r = proc_dointvec(table, write, buffer, lenp, ppos);
>> +       r = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
>>         if (r)
>>                 return r;
>>
>> @@ -224,7 +224,7 @@ int proc_lasat_prid(struct ctl_table *table, int write,
>>         {
>>                 .procname       = "rtc",
>>                 .data           = &rtctmp,
>> -               .maxlen         = sizeof(int),
>> +               .maxlen         = sizeof(time64_t),
>>                 .mode           = 0644,
>>                 .proc_handler   = proc_dolasatrtc,
>>         },
>
> Something seems wrong here: time64_t is not the same as 'unsigned long',
> and the 'rtctmp' variable is still 'unsigned int'. Not sure what the right fix
> would be (we don't seem to have a sysctl helper for s64), but the change
> here makes it worse.

After checking again, I agree with you. So I will keep the original code here.

-- 
Baolin.wang
Best Regards

      reply	other threads:[~2018-05-04  6:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03  2:53 [PATCH 1/2] MIPS: Convert read_persistent_clock() to read_persistent_clock64() Baolin Wang
2018-05-03  2:53 ` [PATCH 2/2] MIPS: Convert update_persistent_clock() to update_persistent_clock64() Baolin Wang
2018-05-03 22:31   ` Arnd Bergmann
2018-05-04  6:23     ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMz4ku+WbtBGGcmsYmMexxcBTJONHF3J-T8Sxo7wgHoZZCVt1w@mail.gmail.com \
    --to=baolin.wang@linaro.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=chenhc@lemote.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=jhogan@kernel.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    --cc=paul.burton@mips.com \
    --cc=pombredanne@nexb.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.