From: ohyama_sec@ariel-networks.com
To: linux-kernel@vger.kernel.org
Subject: [PATCH] x86 : omit duplicate processing at pte_pgprot()
Date: Mon, 10 Aug 2009 00:43:12 +0900 (JST) [thread overview]
Message-ID: <20090809154312.62D1A378124@ns.ariel-networks.com> (raw)
I suggest following PATCH that omit duplicate processing of mask.
pte_pgprot() macro [arch/x86/include/asm/pgtable.h] call pte_flags() [arch/x86/include/asm/pgtable_types.h] that return value is masked by PTE_FLAGS_MASK in pte_flags() function, and this macro also masks the returned value by PTE_FLAGS_MASK.
I guess that we don't have to do the mask processing at pte_pgprot() macro because it has already been masked at pte_flags().
So, how about the following PATCH ?
<Hiroyasu OHYAMA>
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 3cc06e3..a0b454c 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -265,7 +265,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
return __pgprot(preservebits | addbits);
}
-#define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK)
+#define pte_pgprot(x) __pgprot(pte_flags(x))
#define canon_pgprot(p) __pgprot(massage_pgprot(p))
next reply other threads:[~2009-08-09 15:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-09 15:43 ohyama_sec [this message]
2009-08-15 7:10 ` Jeremy Fitzhardinge
2009-08-15 18:46 ohyama_sec
2009-08-16 2:00 ohyama_sec
2009-08-16 2:01 ohyama_sec
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=20090809154312.62D1A378124@ns.ariel-networks.com \
--to=ohyama_sec@ariel-networks.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®