From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: linux-sh@vger.kernel.org
Subject: [PATCH v2] sh: Update kmem_cache_flag.
Date: Thu, 02 Aug 2018 12:21:36 +0000 [thread overview]
Message-ID: <20180802122136.127494-1-ysato@users.sourceforge.jp> (raw)
__GFP_ZERO and the constructor are exclusive relationships,
so it is incorrect to specify them at the same time.
---
arch/sh/mm/pgtable.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/sh/mm/pgtable.c b/arch/sh/mm/pgtable.c
index 5c8f9247c3c2..5a54c2bce2de 100644
--- a/arch/sh/mm/pgtable.c
+++ b/arch/sh/mm/pgtable.c
@@ -2,8 +2,6 @@
#include <linux/mm.h>
#include <linux/slab.h>
-#define PGALLOC_GFP GFP_KERNEL | __GFP_ZERO
-
static struct kmem_cache *pgd_cachep;
#if PAGETABLE_LEVELS > 2
static struct kmem_cache *pmd_cachep;
@@ -32,7 +30,9 @@ void pgtable_cache_init(void)
pgd_t *pgd_alloc(struct mm_struct *mm)
{
- return kmem_cache_alloc(pgd_cachep, PGALLOC_GFP);
+ pgd_t *pgd = kmem_cache_alloc(pgd_cachep, GFP_KERNEL);
+ memset(pgd, 0, kmem_cache_size(pgd_cachep));
+ return pgd;
}
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
@@ -48,7 +48,7 @@ void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
- return kmem_cache_alloc(pmd_cachep, PGALLOC_GFP);
+ return kmem_cache_alloc(pmd_cachep, GFP_KERNEL | __GFP_ZERO);
}
void pmd_free(struct mm_struct *mm, pmd_t *pmd)
--
2.11.0
next reply other threads:[~2018-08-02 12:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 12:21 Yoshinori Sato [this message]
2018-08-02 12:50 ` [PATCH v2] sh: Update kmem_cache_flag Geert Uytterhoeven
2018-08-02 14:03 ` Yoshinori Sato
2018-08-02 14:11 ` Geert Uytterhoeven
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=20180802122136.127494-1-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=linux-sh@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