linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Palmer Dabbelt' <palmer@dabbelt.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Cc: "daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-team@android.com" <kernel-team@android.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	"kernel test robot" <lkp@intel.com>
Subject: RE: [PATCH] clocksource: clint: Avoid remove __iomem in get_cycles_hi()
Date: Tue, 22 Dec 2020 09:34:35 +0000	[thread overview]
Message-ID: <ccc783075aac4ee2b0b43c4644cc992f@AcuMS.aculab.com> (raw)
In-Reply-To: <20201222053230.3229427-1-palmer@dabbelt.com>

From: Palmer Dabbelt
> Sent: 22 December 2020 05:33
> 
> From: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> This cast loses the __iomem qualifier from clint_timer_val, which
> triggers an sparse warning.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> ---
>  drivers/clocksource/timer-clint.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c
> index 6cfe2ab73eb0..83a8b38d46f6 100644
> --- a/drivers/clocksource/timer-clint.c
> +++ b/drivers/clocksource/timer-clint.c
> @@ -63,7 +63,7 @@ static struct riscv_ipi_ops clint_ipi_ops = {
>  #define clint_get_cycles()	readq_relaxed(clint_timer_val)
>  #else
>  #define clint_get_cycles()	readl_relaxed(clint_timer_val)
> -#define clint_get_cycles_hi()	readl_relaxed(((u32 *)clint_timer_val) + 1)
> +#define clint_get_cycles_hi()	readl_relaxed(((u32 __iomem *)clint_timer_val) + 1)
>  #endif

The correct fix is (probably) to define clint_timer_val as u32 on 32bit systems.

Oh - and get rid of those #defines, they are only used in the
functions just below them.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-12-22  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  5:32 [PATCH] clocksource: clint: Avoid remove __iomem in get_cycles_hi() Palmer Dabbelt
2020-12-22  9:34 ` David Laight [this message]
2020-12-23  8:23 ` Christoph Hellwig
2020-12-24  2:59   ` Palmer Dabbelt
2020-12-24  6:39     ` Christoph Hellwig

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=ccc783075aac4ee2b0b43c4644cc992f@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=palmer@dabbelt.com \
    --cc=palmerdabbelt@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).