From: Linn Crosetto <linn@hp.com>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, luto@amacapital.net, daniel.vetter@ffwll.ch,
airlied@redhat.com, yinghai@kernel.org, jacob.shin@amd.com,
penberg@kernel.org, js1304@gmail.com, akpm@linux-foundation.org,
matt.fleming@intel.com
Cc: linux-kernel@vger.kernel.org, Linn Crosetto <linn@hp.com>
Subject: [PATCH 1/3] x86/mm: fix sparse warnings from early_memremap()
Date: Fri, 6 Sep 2013 12:06:55 -0600 [thread overview]
Message-ID: <1378490817-23272-2-git-send-email-linn@hp.com> (raw)
In-Reply-To: <1378490817-23272-1-git-send-email-linn@hp.com>
This patch creates consistent early interfaces for mapping normal memory
and eliminates some sparse warnings.
early_memremap() was created to map normal memory, as opposed to the
ioremap interfaces for actual IO mappings, so remove the __iomem
annotation from early_memremap(). In addition, early_memunmap() is added
to provide an interface analogous to early_iounmap() for normal memory.
Fixes the following warnings:
arch/x86/kernel/setup.c:353:19: warning: incorrect type in assignment (different address spaces)
arch/x86/kernel/setup.c:437:22: warning: incorrect type in assignment (different address spaces)
arch/x86/kernel/setup.c:465:22: warning: incorrect type in assignment (different address spaces)
arch/x86/kernel/setup.c:488:22: warning: incorrect type in assignment (different address spaces)
arch/x86/kernel/e820.c:667:15: warning: incorrect type in assignment (different address spaces)
Signed-off-by: Linn Crosetto <linn@hp.com>
---
arch/x86/include/asm/io.h | 4 ++--
arch/x86/mm/ioremap.c | 9 +++++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 34f69cb..ae1ef3e 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -325,8 +325,8 @@ extern void early_ioremap_init(void);
extern void early_ioremap_reset(void);
extern void __iomem *early_ioremap(resource_size_t phys_addr,
unsigned long size);
-extern void __iomem *early_memremap(resource_size_t phys_addr,
- unsigned long size);
+extern void *early_memremap(resource_size_t phys_addr, unsigned long size);
+extern void early_memunmap(void *addr, unsigned long size);
extern void early_iounmap(void __iomem *addr, unsigned long size);
extern void fixup_early_ioremap(void);
extern bool is_early_ioremap_ptep(pte_t *ptep);
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 799580c..a144929 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -562,10 +562,15 @@ early_ioremap(resource_size_t phys_addr, unsigned long size)
}
/* Remap memory */
-void __init __iomem *
+void __init *
early_memremap(resource_size_t phys_addr, unsigned long size)
{
- return __early_ioremap(phys_addr, size, PAGE_KERNEL);
+ return (__force void *)__early_ioremap(phys_addr, size, PAGE_KERNEL);
+}
+
+void __init early_memunmap(void *addr, unsigned long size)
+{
+ early_iounmap((void __iomem *)addr, size);
}
void __init early_iounmap(void __iomem *addr, unsigned long size)
--
1.7.11.3
next prev parent reply other threads:[~2013-09-06 18:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 21:00 [PATCH] x86: selective remapping in parse_setup_data() Linn Crosetto
2013-08-12 21:08 ` H. Peter Anvin
2013-08-12 23:01 ` [PATCH v2] " Linn Crosetto
2013-08-12 23:30 ` Yinghai Lu
2013-08-13 21:46 ` [PATCH v3] x86: avoid remapping data " Linn Crosetto
2013-08-13 22:22 ` Yinghai Lu
2013-08-14 6:26 ` Pekka Enberg
2013-09-01 11:40 ` [tip:x86/mm] " tip-bot for Linn Crosetto
2013-09-01 23:15 ` [PATCH v3] " H. Peter Anvin
2013-09-06 18:06 ` [PATCH 0/3] x86/mm: fix early_memremap() sparse warnings Linn Crosetto
2013-09-06 18:06 ` Linn Crosetto [this message]
2013-09-06 18:06 ` [PATCH 2/3] x86: fix sparse warning in parse_e820_ext() Linn Crosetto
2013-09-06 18:06 ` [PATCH 3/3] x86: fix early_iounmap() sparse warnings in setup.c Linn Crosetto
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=1378490817-23272-2-git-send-email-linn@hp.com \
--to=linn@hp.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.vetter@ffwll.ch \
--cc=hpa@zytor.com \
--cc=jacob.shin@amd.com \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=matt.fleming@intel.com \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).