diff mbox series

[RESEND,1/3] rtc: Use time64_t to save range_max of RTC

Message ID b8a475beaa4739032e3346572af2e412ebccb787.1519633350.git.baolin.wang@linaro.org
State New
Headers show
Series [RESEND,1/3] rtc: Use time64_t to save range_max of RTC | expand

Commit Message

(Exiting) Baolin Wang Feb. 26, 2018, 8:33 a.m. UTC
We need use rtc->range_max to valid if the time values are valid,
and the time values are saved by time64_t type. So change the
rtc->range_max to time64_t type for comparison correctly.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

---
 include/linux/rtc.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.7.9.5

Comments

Alexandre Belloni March 7, 2018, 10:54 p.m. UTC | #1
Hi,

On 26/02/2018 at 16:33:56 +0800, Baolin Wang wrote:
> We need use rtc->range_max to valid if the time values are valid,

> and the time values are saved by time64_t type. So change the

> rtc->range_max to time64_t type for comparison correctly.

> 


I'm not applying this one because the described issue will never happen
as negative times are forbidden by the rtc subsystem.

I've applied the two following patches

> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

> ---

>  include/linux/rtc.h |    2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/include/linux/rtc.h b/include/linux/rtc.h

> index bdfc0c4..8560282 100644

> --- a/include/linux/rtc.h

> +++ b/include/linux/rtc.h

> @@ -152,7 +152,7 @@ struct rtc_device {

>  	struct bin_attribute *nvram;

>  

>  	time64_t range_min;

> -	timeu64_t range_max;

> +	time64_t range_max;

>  

>  #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL

>  	struct work_struct uie_task;

> -- 

> 1.7.9.5

> 


-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
(Exiting) Baolin Wang March 8, 2018, 2:47 a.m. UTC | #2
Hi Alexandre,

On 8 March 2018 at 06:54, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> Hi,

>

> On 26/02/2018 at 16:33:56 +0800, Baolin Wang wrote:

>> We need use rtc->range_max to valid if the time values are valid,

>> and the time values are saved by time64_t type. So change the

>> rtc->range_max to time64_t type for comparison correctly.

>>

>

> I'm not applying this one because the described issue will never happen

> as negative times are forbidden by the rtc subsystem.


OK.

>

> I've applied the two following patches

>


Thanks.


-- 
Baolin.wang
Best Regards
diff mbox series

Patch

diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index bdfc0c4..8560282 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -152,7 +152,7 @@  struct rtc_device {
 	struct bin_attribute *nvram;
 
 	time64_t range_min;
-	timeu64_t range_max;
+	time64_t range_max;
 
 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
 	struct work_struct uie_task;