[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160822233320.4548-15-nicstange@gmail.com>
Date: Tue, 23 Aug 2016 01:33:12 +0200
From: Nicolai Stange <nicstange@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: John Stultz <john.stultz@...aro.org>, linux-kernel@...r.kernel.org,
Nicolai Stange <nicstange@...il.com>
Subject: [RFC v4 14/22] clockevents: clockevents_program_event(): turn clc into unsigned long
Right now, being of type unsigned long long, the clc local variable in
clockevents_program_event() is unnecessarily wide as it gets cast to
unsigned long anyway.
Degrade clc's type to unsigned long and remove the now superfluous casts.
Signed-off-by: Nicolai Stange <nicstange@...il.com>
---
kernel/time/clockevents.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 7832050..8fddb67 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -311,7 +311,7 @@ static int clockevents_program_min_delta(struct clock_event_device *dev)
int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
bool force)
{
- unsigned long long clc;
+ unsigned long clc;
int64_t delta;
int rc;
@@ -337,11 +337,12 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
if (delta <= 0)
return force ? clockevents_program_min_delta(dev) : -ETIME;
- clc = ((unsigned long long) delta * dev->mult) >> dev->shift;
- clc = min_t(unsigned long, clc, dev->max_delta_ticks);
- clc = max_t(unsigned long, clc, dev->min_delta_ticks_adjusted);
+ clc = (unsigned long)(((unsigned long long)delta *
+ dev->mult) >> dev->shift);
+ clc = min(clc, dev->max_delta_ticks);
+ clc = max(clc, dev->min_delta_ticks_adjusted);
- rc = dev->set_next_event((unsigned long) clc, dev);
+ rc = dev->set_next_event(clc, dev);
return (rc && force) ? clockevents_program_min_delta(dev) : rc;
}
--
2.9.2
Powered by blists - more mailing lists