summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-04-01 11:33:40 +0530
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 15:15:03 +0200
commit522c7c1867854c1df84e4a3a98a37a33d873eb82 (patch)
tree265bb2ddce9e1db5b84cc12cbd1fb72528d4f16f
parentb3b408316c0c250acc3230d63b21a70cbe45c49c (diff)
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 <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19672 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--drivers/rtc/rtc-ab.c8
1 files changed, 5 insertions, 3 deletions
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;