diff options
-rw-r--r-- | drivers/rtc/rtc-lib.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-proc.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 9812120f3a7c..ba795a4db1e9 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c | |||
@@ -94,12 +94,12 @@ EXPORT_SYMBOL(rtc_time_to_tm); | |||
94 | int rtc_valid_tm(struct rtc_time *tm) | 94 | int rtc_valid_tm(struct rtc_time *tm) |
95 | { | 95 | { |
96 | if (tm->tm_year < 70 | 96 | if (tm->tm_year < 70 |
97 | || tm->tm_mon >= 12 | 97 | || ((unsigned)tm->tm_mon) >= 12 |
98 | || tm->tm_mday < 1 | 98 | || tm->tm_mday < 1 |
99 | || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900) | 99 | || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900) |
100 | || tm->tm_hour >= 24 | 100 | || ((unsigned)tm->tm_hour) >= 24 |
101 | || tm->tm_min >= 60 | 101 | || ((unsigned)tm->tm_min) >= 60 |
102 | || tm->tm_sec >= 60) | 102 | || ((unsigned)tm->tm_sec) >= 60) |
103 | return -EINVAL; | 103 | return -EINVAL; |
104 | 104 | ||
105 | return 0; | 105 | return 0; |
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c index 1b2c2caa2a99..2943d83edfd1 100644 --- a/drivers/rtc/rtc-proc.c +++ b/drivers/rtc/rtc-proc.c | |||
@@ -61,7 +61,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset) | |||
61 | seq_printf(seq, "%02d-", alrm.time.tm_mon + 1); | 61 | seq_printf(seq, "%02d-", alrm.time.tm_mon + 1); |
62 | else | 62 | else |
63 | seq_printf(seq, "**-"); | 63 | seq_printf(seq, "**-"); |
64 | if ((unsigned int)alrm.time.tm_mday <= 31) | 64 | if (alrm.time.tm_mday && (unsigned int)alrm.time.tm_mday <= 31) |
65 | seq_printf(seq, "%02d\n", alrm.time.tm_mday); | 65 | seq_printf(seq, "%02d\n", alrm.time.tm_mday); |
66 | else | 66 | else |
67 | seq_printf(seq, "**\n"); | 67 | seq_printf(seq, "**\n"); |