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:   Tue, 20 Jun 2017 13:41:01 +0000
From:   Steve Twiss <stwiss.opensource@...semi.com>
To:     Benjamin Gaignard <benjamin.gaignard@...aro.org>
CC:     "linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>,
        "Support Opensource" <Support.Opensource@...semi.com>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        "rtc-linux@...glegroups.com" <rtc-linux@...glegroups.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 14/51] rtc: da9063: stop using rtc deprecated functions

Hi Benjamin,

On 20 June 2017 10:35, Benjamin Gaignard wrote:

> Subject: [PATCH 14/51] rtc: da9063: stop using rtc deprecated functions

Probably this subject should be "rtc: da9052" not 63.

> rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they
> rely on 32bits variables and that will make rtc break in y2038/2016.
> Stop using those two functions to safer 64bits ones.
> 
[...]

> ---
>  drivers/rtc/rtc-da9052.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
> index 4273377..99a0489 100644
> --- a/drivers/rtc/rtc-da9052.c
> +++ b/drivers/rtc/rtc-da9052.c
> @@ -104,17 +104,15 @@ static int da9052_read_alarm(struct da9052_rtc
> *rtc, struct rtc_time *rtc_tm)
>  static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm)
>  {
>  	struct da9052 *da9052 = rtc->da9052;
> -	unsigned long alm_time;
> +	unsigned long long alm_time;
>  	int ret;
>  	uint8_t v[3];
> 
> -	ret = rtc_tm_to_time(rtc_tm, &alm_time);
> -	if (ret != 0)
> -		return ret;
> +	alm_time = rtc_tm_to_time64(rtc_tm);

But they kind of use the same functions anyway.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/rtc.h?h=v4.12-rc6#n35
And I think they they are abstracted on purpose.

The DA9052/53 hardware can only handle alarms up to the end of 2063.

Regards,
Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ