Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254424

Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem
Date 2015-10-23 11:30 +0200
Message-ID <qmGPD-5Ae-1@gated-at.bofh.it> (permalink)
References <qleC5-8fX-3@gated-at.bofh.it> <qmGmD-4MY-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Friday 23 October 2015 16:53:26 WEN Pingbo wrote:
> 1. Converting timeval to ktime_t, and there is no need to handle sec and
> usec separately
> 
> 2. hp_sdc.rtv is only used for time diff, monotonic time is better here
> 
> Signed-off-by: WEN Pingbo <pingbo.wen@linaro.org>
> ---

This version is still correct and looks better than the first version, but
I'd still like you to improve some details:

- read some other changelogs and follow the common style. In particular,
  in the subject line say /what/ you do ("e.g. use ktime_get instead of
  do_gettimeofday",  or "avoid using struct timespec") instead of /why/,
  but then explain in the changelog text what is wrong with the current
  version and why it gets changed like this.

- Below the '---', add a short list of things you have changed since
  the previous versions. This part will not get copied into the git
  history.

> -		do_gettimeofday(&tv);
> -		if (tv.tv_sec > hp_sdc.rtv.tv_sec)
> -			tv.tv_usec += USEC_PER_SEC;
> -
> -		if (tv.tv_usec - hp_sdc.rtv.tv_usec > HP_SDC_MAX_REG_DELAY) {
> +		if (time_diff.tv64 > HP_SDC_MAX_REG_DELAY) {
>  			hp_sdc_transaction *curr;
>  			uint8_t tmp;
>  
> -			printk(KERN_WARNING PREFIX "read timeout (%ius)!\n",
> -			       (int)(tv.tv_usec - hp_sdc.rtv.tv_usec));
> +			printk(KERN_WARNING PREFIX "read timeout (%llins)!\n",
> +			       time_diff.tv64);
>  			curr->idx += hp_sdc.rqty;
>  			hp_sdc.rqty = 0;
>  			tmp = curr->seq[curr->actidx];

A tiny style comment here: please use ktime_to_ns() to extract the
nanoseconds out of the ktime_t type rather than accessing the tv64
member directly.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] hp_sdc: fixed y2038 problem WEN Pingbo <pingbo.wen@linaro.org> - 2015-10-18 11:50 +0200
  Re: [Y2038] [PATCH] hp_sdc: fixed y2038 problem Arnd Bergmann <arnd@arndb.de> - 2015-10-19 11:10 +0200
    Re: [Y2038] [PATCH] hp_sdc: fixed y2038 problem Pingbo Wen <pingbo.wen@linaro.org> - 2015-10-21 11:00 +0200
    [PATCH V2] hp_sdc: fixed y2038 problem WEN Pingbo <pingbo.wen@linaro.org> - 2015-10-23 11:00 +0200
      Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem Arnd Bergmann <arnd@arndb.de> - 2015-10-23 11:30 +0200
        Re: [Y2038] [PATCH V2] hp_sdc: fixed y2038 problem Pingbo Wen <pingbo.wen@linaro.org> - 2015-10-23 11:40 +0200
        [PATCH V3] hp_sdc: convert struct timeval to ktime_t WEN Pingbo <pingbo.wen@linaro.org> - 2015-10-23 13:40 +0200
          Re: [PATCH V3] hp_sdc: convert struct timeval to ktime_t Arnd Bergmann <arnd@arndb.de> - 2015-10-23 13:50 +0200
            Re: [PATCH V3] hp_sdc: convert struct timeval to ktime_t Pingbo Wen <pingbo.wen@linaro.org> - 2015-10-23 14:20 +0200
              Re: [PATCH V3] hp_sdc: convert struct timeval to ktime_t Arnd Bergmann <arnd@arndb.de> - 2015-10-23 14:40 +0200
                [PATCH V4] hp_sdc: convert struct timeval to ktime_t WEN Pingbo <pingbo.wen@linaro.org> - 2015-10-24 06:10 +0200

csiph-web