From: "Jan Beulich" <jbeulich@novell.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <hpa@zytor.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: clean up pgd_{c,d}tor
Date: Fri, 18 Jul 2008 13:47:45 +0100 [thread overview]
Message-ID: <4880AD11.76E4.0078.0@novell.com> (raw)
Giving pgd_ctor() a properly typed parameter allows eliminating a local
variable. Adjust pgd_dtor() to match.
Also, pgd_ctor()'s clearing of the memory is redundant with the
GFP_ZERO used for allocating it.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/x86/mm/pgtable.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- linux-2.6.26/arch/x86/mm/pgtable.c 2008-07-13 23:51:29.000000000 +0200
+++ 2.6.26-x86-pgd-alloc-cleanup/arch/x86/mm/pgtable.c 2008-06-25 14:35:40.000000000 +0200
@@ -62,14 +62,10 @@ static inline void pgd_list_del(pgd_t *p
#define UNSHARED_PTRS_PER_PGD \
(SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
-static void pgd_ctor(void *p)
+static void pgd_ctor(pgd_t *pgd)
{
- pgd_t *pgd = p;
unsigned long flags;
- /* Clear usermode parts of PGD */
- memset(pgd, 0, KERNEL_PGD_BOUNDARY*sizeof(pgd_t));
-
spin_lock_irqsave(&pgd_lock, flags);
/* If the pgd points to a shared pagetable level (either the
@@ -94,7 +90,7 @@ static void pgd_ctor(void *p)
spin_unlock_irqrestore(&pgd_lock, flags);
}
-static void pgd_dtor(void *pgd)
+static void pgd_dtor(pgd_t *pgd)
{
unsigned long flags; /* can be called from interrupt context */
next reply other threads:[~2008-07-18 12:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 12:47 Jan Beulich [this message]
2008-07-18 14:52 ` [PATCH] x86: clean up pgd_{c,d}tor Jeremy Fitzhardinge
2008-07-18 15:23 ` Jan Beulich
2008-07-18 16:08 ` Jeremy Fitzhardinge
2008-07-18 16:15 ` Jeremy Fitzhardinge
2008-07-18 23:15 ` H. Peter Anvin
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=4880AD11.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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).