From patchwork Thu Aug 2 12:21:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 10553539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAA1C13BB for ; Thu, 2 Aug 2018 12:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFEEF2BDC7 for ; Thu, 2 Aug 2018 12:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE4752BDE4; Thu, 2 Aug 2018 12:21:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 416E02BDC7 for ; Thu, 2 Aug 2018 12:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732252AbeHBOMl (ORCPT ); Thu, 2 Aug 2018 10:12:41 -0400 Received: from mail01.asahi-net.or.jp ([202.224.55.13]:55089 "EHLO mail01.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728797AbeHBOMl (ORCPT ); Thu, 2 Aug 2018 10:12:41 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.vps.ablenet.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail01.asahi-net.or.jp (Postfix) with ESMTPA id 6670285D57; Thu, 2 Aug 2018 21:21:44 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM028236.ppp.dion.ne.jp [222.8.28.236]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 9112724006D; Thu, 2 Aug 2018 21:21:43 +0900 (JST) From: Yoshinori Sato To: dalias@libc.org, linux-sh@vger.kernel.org Cc: Yoshinori Sato Subject: [PATCH v2] sh: Update kmem_cache_flag. Date: Thu, 2 Aug 2018 21:21:36 +0900 Message-Id: <20180802122136.127494-1-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180731051519.101249-1-ysato@users.sourceforge.jp> References: <20180731051519.101249-1-ysato@users.sourceforge.jp> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __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 #include -#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)