Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource/fsl: Avoid harmless 64-bit warnings

The ftm_clockevent_init passes the value of "~0UL" into a function
that takes a 32-bit argument, which drops the upper 32 bits, as
gcc warns about on ARM64:

clocksource/fsl_ftm_timer.c: In function 'ftm_clockevent_init':
clocksource/fsl_ftm_timer.c:206:13: warning: large integer implicitly truncated to unsigned type [-Woverflow]

This was obviously unintended behavior, and is easily avoided by
using '~0u' as the integer literal, because that is 32-bit wide
on all architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Xiubo Li <Li.Xiubo@freescale.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: http://lkml.kernel.org/r/3990834.xnjhm37Grs@wuerfel
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Arnd Bergmann and committed by
Thomas Gleixner
dde7632e 8005c49d

+2 -2
+2 -2
drivers/clocksource/fsl_ftm_timer.c
··· 203 203 int err; 204 204 205 205 ftm_writel(0x00, priv->clkevt_base + FTM_CNTIN); 206 - ftm_writel(~0UL, priv->clkevt_base + FTM_MOD); 206 + ftm_writel(~0u, priv->clkevt_base + FTM_MOD); 207 207 208 208 ftm_reset_counter(priv->clkevt_base); 209 209 ··· 230 230 int err; 231 231 232 232 ftm_writel(0x00, priv->clksrc_base + FTM_CNTIN); 233 - ftm_writel(~0UL, priv->clksrc_base + FTM_MOD); 233 + ftm_writel(~0u, priv->clksrc_base + FTM_MOD); 234 234 235 235 ftm_reset_counter(priv->clksrc_base); 236 236