X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Frtc%2Frtc-lib.c;h=9f996ec881ce90dbf2a97cef5ecb73e090d634c7;hb=5dc93cf4576125f07cfc1b29cab0c9344c5b3d2b;hp=9812120f3a7c825c783a7c15635279740ced383d;hpb=f6e6e883730aff2718610d3eba7608fcf73328ed;p=linux-2.6-omap-h63xx.git diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 9812120f3a7..9f996ec881c 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c @@ -51,7 +51,7 @@ EXPORT_SYMBOL(rtc_year_days); */ void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) { - register int days, month, year; + unsigned int days, month, year; days = time / 86400; time -= days * 86400; @@ -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;