diff options
Diffstat (limited to 'drivers/rtc/rtc-lib.c')
-rw-r--r-- | drivers/rtc/rtc-lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 9f996ec881ce..dd70bf73ce9d 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c | |||
@@ -51,10 +51,11 @@ EXPORT_SYMBOL(rtc_year_days); | |||
51 | */ | 51 | */ |
52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) | 52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) |
53 | { | 53 | { |
54 | unsigned int days, month, year; | 54 | unsigned int month, year; |
55 | int days; | ||
55 | 56 | ||
56 | days = time / 86400; | 57 | days = time / 86400; |
57 | time -= days * 86400; | 58 | time -= (unsigned int) days * 86400; |
58 | 59 | ||
59 | /* day of the week, 1970-01-01 was a Thursday */ | 60 | /* day of the week, 1970-01-01 was a Thursday */ |
60 | tm->tm_wday = (days + 4) % 7; | 61 | tm->tm_wday = (days + 4) % 7; |