]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/rtc-lib.c
Pull misc into release branch
[linux-2.6-omap-h63xx.git] / drivers / rtc / rtc-lib.c
index 9812120f3a7c825c783a7c15635279740ced383d..ba795a4db1e97289829c3c69dbee613fa2720a25 100644 (file)
@@ -94,12 +94,12 @@ EXPORT_SYMBOL(rtc_time_to_tm);
 int rtc_valid_tm(struct rtc_time *tm)
 {
        if (tm->tm_year < 70
-               || tm->tm_mon >= 12
+               || ((unsigned)tm->tm_mon) >= 12
                || tm->tm_mday < 1
                || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900)
-               || tm->tm_hour >= 24
-               || tm->tm_min >= 60
-               || tm->tm_sec >= 60)
+               || ((unsigned)tm->tm_hour) >= 24
+               || ((unsigned)tm->tm_min) >= 60
+               || ((unsigned)tm->tm_sec) >= 60)
                return -EINVAL;
 
        return 0;