From: Nicolai Stange <nicstange@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-sparse@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] include/linux/compiler.h: unconditionally define __pmem sparse attribute
Date: Tue, 07 Jul 2015 17:41:32 +0200 [thread overview]
Message-ID: <87fv50c6vn.fsf@gmail.com> (raw)
Commit 61031952f4c8 ("arch, x86: pmem api for ensuring durability of
persistent memory updates")
defined __pmem in include/linux/compiler.h only for the case
CONFIG_RCU_SPARSE_POINTER=n, probably by accident.
With CONFIG_RCU_SPARSE_POINTER=y a sparse compile gives the error:
CHECK init/main.c
arch/x86/include/asm/io.h:251:27: error: void declaration
arch/x86/include/asm/io.h:251:27: error: Expected ; at end of declaration
arch/x86/include/asm/io.h:251:27: error: got *
arch/x86/include/asm/io.h:255:1: error: Expected ; at the end of
type declaration
arch/x86/include/asm/io.h:255:1: error: got }
This happens because the __pmem in
arch/x86/include/asm/io.h:251:
static inline void __pmem *arch_memremap_pmem([...])
is undefined.
Define __pmem unconditionally in include/linux/compiler.h.
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
include/linux/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 7f8ad95..4f85b58 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -21,8 +21,8 @@
# define __rcu __attribute__((noderef, address_space(4)))
#else
# define __rcu
-# define __pmem __attribute__((noderef, address_space(5)))
#endif
+# define __pmem __attribute__((noderef, address_space(5)))
extern void __chk_user_ptr(const volatile void __user *);
extern void __chk_io_ptr(const volatile void __iomem *);
#else
--
2.4.5
next reply other threads:[~2015-07-07 15:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 15:41 Nicolai Stange [this message]
2015-07-07 15:45 ` Ross Zwisler
2015-07-07 15:47 ` Nicolai Stange
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=87fv50c6vn.fsf@gmail.com \
--to=nicstange@gmail.com \
--cc=ross.zwisler@linux.intel.com \
--cc=sparse@chrisli.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®