lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 01 Jun 2015 21:53:03 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Xunlei Pang <xlpang@....com>
Cc:	linux-kernel@...r.kernel.org, rtc-linux@...glegroups.com,
	Alessandro Zummo <a.zummo@...ertech.it>,
	John Stultz <john.stultz@...aro.org>,
	Xunlei Pang <pang.xunlei@...aro.org>,
	Carlo Caione <carlo.caione@...il.com>
Subject: Re: [PATCH RESEND 3/3] drivers/rtc/sunxi: Replace deprecated rtc_tm_to_time()

On Friday 29 May 2015 23:04:37 Xunlei Pang wrote:
>         }
>  
> -       rtc_tm_to_time(alrm_tm, &time_set);
> -       rtc_tm_to_time(&tm_now, &time_now);
> +       time_set = rtc_tm_to_time64(alrm_tm);
> +       time_now = rtc_tm_to_time64(&tm_now);
>         if (time_set <= time_now) {
>                 dev_err(dev, "Date to set in the past\n");
>                 return -EINVAL;
>         }
>  
> +       if (time_set > time_now + 255 * SEC_IN_DAY) {
> +               dev_err(dev, "Day must be in the range 0 - 255\n");
> +               return -EINVAL;
> +       }
> +
> 

So this driver also uses the two values just to do a comparison
and to take the difference in seconds.

If we have a helper function that returns the difference between
two rtc_tm values as a time64_t, we can use that for both
this driver and isl1208.

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

Powered by blists - more mailing lists