All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arnd Bergmann <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
	mingo@kernel.org, kernel@pengutronix.de, stefan@agner.ch,
	arnd@arndb.de, hpa@zytor.com, daniel.lezcano@linaro.org,
	shawnguo@kernel.org, Li.Xiubo@freescale.com
Subject: [tip:timers/urgent] clocksource/fsl: Avoid harmless 64-bit warnings
Date: Tue, 17 Nov 2015 02:36:45 -0800	[thread overview]
Message-ID: <tip-dde7632ed02382e4bac2b57c66ee2285764f2cd7@git.kernel.org> (raw)
In-Reply-To: <3990834.xnjhm37Grs@wuerfel>

Commit-ID:  dde7632ed02382e4bac2b57c66ee2285764f2cd7
Gitweb:     http://git.kernel.org/tip/dde7632ed02382e4bac2b57c66ee2285764f2cd7
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Mon, 16 Nov 2015 17:34:50 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 16 Nov 2015 19:07:08 +0100

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>

---
 drivers/clocksource/fsl_ftm_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 10202f1..517e1c7 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -203,7 +203,7 @@ static int __init ftm_clockevent_init(unsigned long freq, int irq)
 	int err;
 
 	ftm_writel(0x00, priv->clkevt_base + FTM_CNTIN);
-	ftm_writel(~0UL, priv->clkevt_base + FTM_MOD);
+	ftm_writel(~0u, priv->clkevt_base + FTM_MOD);
 
 	ftm_reset_counter(priv->clkevt_base);
 
@@ -230,7 +230,7 @@ static int __init ftm_clocksource_init(unsigned long freq)
 	int err;
 
 	ftm_writel(0x00, priv->clksrc_base + FTM_CNTIN);
-	ftm_writel(~0UL, priv->clksrc_base + FTM_MOD);
+	ftm_writel(~0u, priv->clksrc_base + FTM_MOD);
 
 	ftm_reset_counter(priv->clksrc_base);
 

  parent reply	other threads:[~2015-11-17 10:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 16:34 [PATCH] clocksource: fsl: avoid harmless 64-bit warnings Arnd Bergmann
2015-11-16 16:34 ` Arnd Bergmann
2015-11-17  9:37 ` Daniel Lezcano
2015-11-17  9:37   ` Daniel Lezcano
2015-11-17 10:36 ` tip-bot for Arnd Bergmann [this message]
2015-11-17 11:25   ` [tip:timers/urgent] clocksource/fsl: Avoid " Daniel Lezcano
2015-11-17 11:36     ` Thomas Gleixner
2015-11-17 11:43       ` Daniel Lezcano
2015-11-17 11:45         ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-dde7632ed02382e4bac2b57c66ee2285764f2cd7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=Li.Xiubo@freescale.com \
    --cc=arnd@arndb.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=hpa@zytor.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.