Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp505060yba; Wed, 3 Apr 2019 13:07:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9UqB1AnU2j1s1qwWjcq7UN3XdkMfELoqv9VZyg7qXuMH3wHEN9kniLv46Ktm5kc7JppQA X-Received: by 2002:a62:a219:: with SMTP id m25mr1403055pff.197.1554322053454; Wed, 03 Apr 2019 13:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554322053; cv=none; d=google.com; s=arc-20160816; b=MfPgMXtbMyPPHgP8mgxZYQwcW4g0VMVb4mgp8XG045PIt9EyGr3ZgwcvUyL0oylIXV JuqSd6H7sT3AMAAfiNxAQ3oGrz8eFfBw19ysVMhk6tUV3heH73Qi1qBdBHuQh8stFOLH 5XOs6BOmgHX+KsguOJLWhyWvSeEjqQu4a8sbGhO0T5x1SHcFIf2eIIRi8PAEZ+ZePa85 coyH1jUpKkrHJCL8YkfQN0ntdLnt9MhaGm0iuiyuKiogzt/9ukoPoQh7idjAW7f6KrKd JlVBMYuaxLNctR6zMpuafUOAk2R/vMLM7UDi5jsrfpX/r3cLRjGDbyIbRRKPbE5iUBGo uNzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=83xPdMubQ9TI2dV0cl8TnZ18eHRoYYi1ptzaynCcobI=; b=WkRt+MybLFIVB8yT5elEkJqTX1F235pFCv+AIhQYja1fUNWWCmmNRSU9yQdNyi4ep6 k97Nxdf8WuQS1Ryh0r08t0DxdG/5UmyNYMaWJpVeMTM7vP/gmX1r1jXd+zXnKa2wM/f7 hB0GAvet/WPiFjHX3Ji6QbEc05LzIDt6XTvy6gecQoGaRQl3fEWBHoB5Z7hs8tyr6Mk+ O+nRq/UHLX0pZpnuf0tvD01xLImtnrfvZA96gJ4bF/tKUbCFMLug5miu0sTHAnGkB9Id Xj9uKohR61LasYVDIWF1emLJfQdBFQTudG89bukFW4s8vlC20zoiJCeEcWpdfcl5YovW zHDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WQIns6iB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j133si14521000pgc.543.2019.04.03.13.07.17; Wed, 03 Apr 2019 13:07:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WQIns6iB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbfDCUGb (ORCPT + 99 others); Wed, 3 Apr 2019 16:06:31 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:22434 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbfDCUG2 (ORCPT ); Wed, 3 Apr 2019 16:06:28 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44ZHCQ6gHgz9v3pp; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=WQIns6iB; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id OrLqd6ybMcLt; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44ZHCQ5ZgCz9v3pn; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1554321986; bh=83xPdMubQ9TI2dV0cl8TnZ18eHRoYYi1ptzaynCcobI=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=WQIns6iBWdE6jaOdm6Br9B/S4i3OeM3sV/3QOf8F/xsl7fF4L6GPp3kQfuI7vyZic ar809nFi6DsbH/0wTD2xbmgom1f/F5P9j7rlwLaqIjR9zoVysNoHjRUVaG4PE6iC3L Ml2h/ybhO5uSQn5wO0Ov5K+g4ollJs1AiERPHa5Y= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E34BF8B905; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id T-Z8-pTgKXSC; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BD5DE8B902; Wed, 3 Apr 2019 22:06:26 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 97461655EC; Wed, 3 Apr 2019 20:06:26 +0000 (UTC) Message-Id: <48d8eb7326806e7f6e4d1eb210adb95a2c9f6ff5.1554321743.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 14/15] powerpc/mm: refactor pmd_pgtable() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 3 Apr 2019 20:06:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pmd_pgtable() is identical on the 4 subarches, refactor it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgalloc.h | 2 -- arch/powerpc/include/asm/book3s/64/pgalloc.h | 5 ----- arch/powerpc/include/asm/nohash/32/pgalloc.h | 2 -- arch/powerpc/include/asm/nohash/64/pgalloc.h | 2 -- arch/powerpc/include/asm/pgalloc.h | 5 +++++ 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/pgalloc.h b/arch/powerpc/include/asm/book3s/32/pgalloc.h index 1b9b5c228230..998317702630 100644 --- a/arch/powerpc/include/asm/book3s/32/pgalloc.h +++ b/arch/powerpc/include/asm/book3s/32/pgalloc.h @@ -37,8 +37,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, *pmdp = __pmd(__pa(pte_page) | _PMD_PRESENT); } -#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) - static inline void pgtable_free(void *table, unsigned index_size) { if (!index_size) { diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h index df2dce6afe14..053a7940504e 100644 --- a/arch/powerpc/include/asm/book3s/64/pgalloc.h +++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h @@ -163,11 +163,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, *pmd = __pmd(__pgtable_ptr_val(pte_page) | PMD_VAL_BITS); } -static inline pgtable_t pmd_pgtable(pmd_t pmd) -{ - return (pgtable_t)pmd_page_vaddr(pmd); -} - static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, unsigned long address) { diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h index 6c0f5151dc1d..137761b01588 100644 --- a/arch/powerpc/include/asm/nohash/32/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h @@ -43,6 +43,4 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, *pmdp = __pmd(__pa(pte_page) | _PMD_USER | _PMD_PRESENT); } -#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) - #endif /* _ASM_POWERPC_PGALLOC_32_H */ diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index c636feced1ff..5a0ea63c77c7 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h @@ -59,8 +59,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pmd_set(pmd, (unsigned long)pte_page); } -#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) - static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX), diff --git a/arch/powerpc/include/asm/pgalloc.h b/arch/powerpc/include/asm/pgalloc.h index 5761bee0f004..2b2c60a1a66d 100644 --- a/arch/powerpc/include/asm/pgalloc.h +++ b/arch/powerpc/include/asm/pgalloc.h @@ -72,4 +72,9 @@ static inline void check_pgt_cache(void) { } #include #endif +static inline pgtable_t pmd_pgtable(pmd_t pmd) +{ + return (pgtable_t)pmd_page_vaddr(pmd); +} + #endif /* _ASM_POWERPC_PGALLOC_H */ -- 2.13.3