public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] sparc64: Add preprocessor symbols for PAGE_* pgprot_t values.
Date: Sun, 02 Nov 2014 21:15:12 +0100	[thread overview]
Message-ID: <545690D0.5040904@ladisch.de> (raw)

Kernel code assumes that the PAGE_* values are preprocessor symbols, and
that therefore arch support can be checked for with #ifdef.

At the moment, sparc64 does not implement any of the symbols checked
for, so these checks happen to work.

To prevent potential breakage when another #ifdef check is added or when
sparc64 implements another PAGE_ value, make such #ifdef checks work by
adding preprocessor symbols on top of the PAGE_* variables.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
 arch/sparc/include/asm/pgtable_64.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index bfeb626..a835fe9 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -216,9 +216,13 @@ pte_t mk_pte_io(unsigned long, pgprot_t, int, unsigned long);
 unsigned long pte_sz_bits(unsigned long size);

 extern pgprot_t PAGE_KERNEL;
+#define PAGE_KERNEL		PAGE_KERNEL
 extern pgprot_t PAGE_KERNEL_LOCKED;
+#define PAGE_KERNEL_LOCKED	PAGE_KERNEL_LOCKED
 extern pgprot_t PAGE_COPY;
+#define PAGE_COPY		PAGE_COPY
 extern pgprot_t PAGE_SHARED;
+#define PAGE_SHARED		PAGE_SHARED

 /* XXX This uglyness is for the atyfb driver's sparc mmap() support. XXX */
 extern unsigned long _PAGE_IE;

             reply	other threads:[~2014-11-02 20:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-02 20:15 Clemens Ladisch [this message]
2014-11-02 23:24 ` [PATCH] sparc64: Add preprocessor symbols for PAGE_* pgprot_t values David Miller
2014-11-03  9:44   ` Clemens Ladisch
2014-11-03 16:29     ` David Miller

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=545690D0.5040904@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.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