From: Thomas Gleixner <tglx@linutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
"H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Subject: Re: [PATCH v2 1/1] x86/early_printk: Use __iomem address space for IO
Date: Sun, 11 Oct 2015 21:18:21 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1510112115190.6097@nanos> (raw)
In-Reply-To: <1444400949-103551-1-git-send-email-andriy.shevchenko@linux.intel.com>
Andy,
On Fri, 9 Oct 2015, Andy Shevchenko wrote:
> #ifdef CONFIG_PCI
> static void mem32_serial_out(unsigned long addr, int offset, int value)
> {
> - u32 *vaddr = (u32 *)addr;
> + void __iomem *vaddr = (void __iomem *)addr;
> /* shift implied by pointer type */
> writel(value, vaddr + offset);
This is broken. Assume vaddr = 0x1000 and offset = 1
==> u32 *vaddr = 0x1000;
==> vaddr + offset = 0x1004
with your change
==> void __iomem *vaddr = 0x1000;
==> vaddr + offset = 0x1001
This comment is there for a reason:
> /* shift implied by pointer type */
Thanks,
tglx
next prev parent reply other threads:[~2015-10-11 19:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 14:29 Andy Shevchenko
2015-10-09 14:35 ` Andy Shevchenko
2015-10-11 19:18 ` Thomas Gleixner [this message]
2015-10-12 8:12 ` Andy Shevchenko
2015-10-12 9:11 ` Thomas Gleixner
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=alpine.DEB.2.11.1510112115190.6097@nanos \
--to=tglx@linutronix.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®