Re: [PATCH 5/6] hwclock: rename/refactor set_system_clock()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 21, 2017 at 08:56:41AM -0400, J William Piggott wrote:
> 
> 
> On 08/21/2017 05:31 AM, Karel Zak wrote:
> > On Fri, Aug 18, 2017 at 08:23:01PM -0400, J William Piggott wrote:
> >>
> >> Signed-off-by: J William Piggott <elseifthen@xxxxxxx>
> >> ---
> >>  sys-utils/hwclock.c | 24 +++++++++---------------
> >>  1 file changed, 9 insertions(+), 15 deletions(-)
> >>
> >> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
> >> index c398d60..4279931 100644
> >> --- a/sys-utils/hwclock.c
> >> +++ b/sys-utils/hwclock.c
> >> @@ -601,12 +601,8 @@ display_time(struct timeval hwctime)
> >>   *                         * only on first call after boot
> >>   */
> >>  static int
> >> -set_system_clock(const struct hwclock_control *ctl,
> >> -		 const struct timeval newtime)
> >> +kernel_time_ctl(const struct hwclock_control *ctl, const struct timeval newtime)
> > 
> > Hmm... the new name does not make the code more readable for me.  
> > 
> > We have "HW-clock" (hc) and "system time", would be nice to keep
> > this terminology for functions names too? 
> 
> I've been moving away from the term 'Hardware Clock' in favor of RTC
> because:
>  * use of /dev/rtcN is the only recommended access now
>  * RTC seems more common (anecdotal observation)
>  * it is more concise for usage() and docs

RTC is fine.

> > IMHO set_system_clock() is not so bad :-) (Maybe use system_set_clock()
> > if you want to use "system_" prefix for more functions.)
> 
> My thinking was that this function does important things besides setting
> the system time. It also sets the kernel's RTC timescale and the
> kernel's timezone. For systz it never sets the system time at all. So
> the current name seems misleading.

kernel_time_ctl() does not inform reader about any operation, as there
is no "set", "get", "read", "manipulate" or so in the name.

> It doesn't matter to me, I was changing it to help others. Do you want me
> to put it back to set_system_clock?

Please, or try something better (set_time(), set_kernel_time(), ...).

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux