public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] clockevents: timer-stm32: Fix build warning spotted by kbuild test robot
@ 2015-05-28  5:05 Maxime Coquelin
  2015-05-28  8:24 ` Daniel Lezcano
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Coquelin @ 2015-05-28  5:05 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Thomas Gleixner, linux-kernel, fengguang.wu, luc.vanoostenryck

This patch fixes below warning spotted by kbuild test robot when building
with ARCH=powerpc:

   drivers/clocksource/timer-stm32.c: In function 'stm32_clockevent_init':
>> drivers/clocksource/timer-stm32.c:140:9: warning: large integer implicitly truncated to unsigned type [-Woverflow]
     writel_relaxed(~0UL, data->base + TIM_ARR);

The fix consists in using 0U instead of 0UL.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
---
v2: Use 0U instead of casting to u32.
---
 drivers/clocksource/timer-stm32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/timer-stm32.c b/drivers/clocksource/timer-stm32.c
index fad2e2e..a97e8b5 100644
--- a/drivers/clocksource/timer-stm32.c
+++ b/drivers/clocksource/timer-stm32.c
@@ -137,9 +137,9 @@ static void __init stm32_clockevent_init(struct device_node *np)
 	}
 
 	/* Detect whether the timer is 16 or 32 bits */
-	writel_relaxed(~0UL, data->base + TIM_ARR);
+	writel_relaxed(~0U, data->base + TIM_ARR);
 	max_delta = readl_relaxed(data->base + TIM_ARR);
-	if (max_delta == ~0UL) {
+	if (max_delta == ~0U) {
 		prescaler = 1;
 		bits = 32;
 	} else {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-28  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  5:05 [PATCH v2] clockevents: timer-stm32: Fix build warning spotted by kbuild test robot Maxime Coquelin
2015-05-28  8:24 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox