From 522c7c1867854c1df84e4a3a98a37a33d873eb82 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Fri, 1 Apr 2011 11:33:40 +0530 Subject: rtc-ab: add missing casts Only the << 24 one is strictly required, but let's just be explicit about all of them. ST-Ericsson Linux next: - ST-Ericsson ID: WP332221 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ib8ae749d6ad21c12160fb4af62b79c347bf1dc75 Signed-off-by: Rabin Vincent Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19672 Reviewed-by: Jonas ABERG --- drivers/rtc/rtc-ab.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-ab.c b/drivers/rtc/rtc-ab.c index 3d3c216995d..8e595e05d99 100644 --- a/drivers/rtc/rtc-ab.c +++ b/drivers/rtc/rtc-ab.c @@ -141,8 +141,8 @@ static unsigned long ab5500_rtc_regs_to_time(struct device *dev, u8 *regs) { u64 fat_time = ((u64)regs[5] << 40) | ((u64)regs[4] << 32) | - (regs[3] << 24) | (regs[2] << 16) | - (regs[1] << 8) | regs[0]; + ((u64)regs[3] << 24) | ((u64)regs[2] << 16) | + ((u64)regs[1] << 8) | regs[0]; unsigned long secs = (fat_time & 0x1fffff) / AB5500_RTC_CLOCK_RATE; unsigned long mins = fat_time >> 21; @@ -170,7 +170,9 @@ ab5500_rtc_alarm_to_regs(struct device *dev, unsigned long secs, u8 *regs) static unsigned long ab5500_rtc_regs_to_alarm(struct device *dev, u8 *regs) { - unsigned long mins = (regs[2] << 16) | (regs[1] << 8) | regs[0]; + unsigned long mins = ((unsigned long)regs[2] << 16) | + ((unsigned long)regs[1] << 8) | + regs[0]; unsigned long secs = mins * 60; return secs; -- cgit v1.2.3