From patchwork Mon Dec 3 15:47:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10709921 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 12863109C for ; Mon, 3 Dec 2018 15:49:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03EE92A06C for ; Mon, 3 Dec 2018 15:49:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB2AA2B4B9; Mon, 3 Dec 2018 15:49:24 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D87912A06C for ; Mon, 3 Dec 2018 15:49:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF3296B69EF; Mon, 3 Dec 2018 10:49:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DC9E26B69F0; Mon, 3 Dec 2018 10:49:22 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBA616B69F1; Mon, 3 Dec 2018 10:49:22 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 8A02A6B69EF for ; Mon, 3 Dec 2018 10:49:22 -0500 (EST) Received: by mail-pf1-f199.google.com with SMTP id s14so11522945pfk.16 for ; Mon, 03 Dec 2018 07:49:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=F/OW/DUqVIHlujdlnbzXQdnGOjtaxC6p3S0GJAT1Axg=; b=luYyitarpMIL9FyGXDzjSVNMFOQ506IHaSclc4i05cW9IxFTvXnPRDtvxcS6khn62W Xt3sAkVwAhW2wcbDpKFcrlMDizO7oYw5IMRYvYyTMaeamIUaJOxuJy6YPN+G/CV/Z7XQ UWh5E1awEy+Kjw5DYHj7yHrDwZUr138S2BldKyhRGGkpMukmOnTnORXUDEEsNOV9M2Ge XUiiMQlZmxcXOgHw6+2M5HRQXs5okF06XfoCD2mkra9jgJEvAHAc9TnlkM8MQsV+sE84 lfNAsU7dVnVoH8XwofbhxoBPIFTXTtz0ADWqs6fW5ddqlfjccRepYcH8AgJ3TcPfYMPq rrzA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AA+aEWbFduJWPevuotfSBHHv2qVaz17GTUMo3W0jWHj38qxBetvT7Fbk oqji36CWmzETSklOyad++rZjuRONKBALKm8bqTXZEFFTiDbcMkmzhOKurgSjrcjqkwDhnf1aI9N xWqVkN3jxifqMJKWVLa11CEo0cP1bsiaKdDNMH1Z6ggT8axRBFwQ0XYynrVqnz5BOCQ== X-Received: by 2002:a62:9657:: with SMTP id c84mr16797487pfe.77.1543852162219; Mon, 03 Dec 2018 07:49:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/UayqYUZGjPihsX3Qyn2jUFrEIdC8daAvCESJ2Ay2Ac8q2L6zPYpkRUEPG2wjdhVCNoF/dT X-Received: by 2002:a62:9657:: with SMTP id c84mr16797448pfe.77.1543852161489; Mon, 03 Dec 2018 07:49:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543852161; cv=none; d=google.com; s=arc-20160816; b=nNH/RsMmGBhd/3iYb6v4UpUWcx+Ca75r9XBWnrUW1Xpqsh4HEWg7qGsi05y7TxqDkh 82PE21IK+5MEtSCn4oIqXwrZFThDkn3oahPvJ7cck0vqE+mYQmcl/9SM8t4f72St4ycX DG66nlKue00jbkDgqDP4y2co8KsOWMKC/IYbHQ9mHOilmwwxBkj9JQ62QirCkhnnnrpZ CTJnGnmzwbEQRAU69O44V94TsbzRq+1bgRULTb4j6EDf1/1xOK3VCxeXGZk2jXt+DwZG 8Pn7E7EuVX8FP65FkmVyuS5ftAvKwnjwyHnD0zwmn9kMotOWUWi9uSHO1SOazsc/ydfP sTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=F/OW/DUqVIHlujdlnbzXQdnGOjtaxC6p3S0GJAT1Axg=; b=VIFBJ5QXnDoIT+gQhlOIh28AdZfV2++bPWqUPk2mYpJDyhXGzFzuGjhG1+EfJ+5cS5 VCYjzSHuch8SR1mcHR1TnPR98KqT+QmtlcOQ0SvuBQN6wZ+4A84BDk75fZwhR0atRfng py6KS9lNXfAsor81k+j+RPojEMnOK7xzij9tpUOfX9Unfr71/ZhATpAl7KgcwBumlfna +rtEv70soK2HEm8e7LOBAb6XMk5zLay4+5BHqJ/Wx0Myv18UX7QszzB/voR2NIk8M4rB EYxTlQRPg25wo4Mt3q4f6tEZZ/VY8Oh0aFoGz80xCPveY9lcR8iPtrUTLWugubBw+rpD 92iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id a5si11967594pgg.120.2018.12.03.07.49.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 07:49:21 -0800 (PST) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB3FiOuE007658 for ; Mon, 3 Dec 2018 10:49:20 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p55xsdqsc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 Dec 2018 10:49:10 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Dec 2018 15:47:54 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 3 Dec 2018 15:47:48 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB3Fllek29229290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Dec 2018 15:47:47 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68D62A4062; Mon, 3 Dec 2018 15:47:47 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3C56AA4064; Mon, 3 Dec 2018 15:47:44 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.206.196]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 3 Dec 2018 15:47:44 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 03 Dec 2018 17:47:43 +0200 From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Benjamin Herrenschmidt , "David S. Miller" , Guan Xuetao , Greentime Hu , Jonas Bonn , Michael Ellerman , Michal Hocko , Michal Simek , Mark Salter , Paul Mackerras , Rich Felker , Russell King , Stefan Kristiansson , Stafford Horne , Vincent Chen , Yoshinori Sato , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, Mike Rapoport Subject: [PATCH v2 6/6] arm, unicore32: remove early_alloc*() wrappers Date: Mon, 3 Dec 2018 17:47:15 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543852035-26634-1-git-send-email-rppt@linux.ibm.com> References: <1543852035-26634-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18120315-4275-0000-0000-000002EB6079 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120315-4276-0000-0000-000037F86483 Message-Id: <1543852035-26634-7-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-03_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812030148 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On arm and unicore32i the early_alloc_aligned() and and early_alloc() are oneliner wrappers for memblock_alloc. Replace their usage with direct call to memblock_alloc. Suggested-by: Christoph Hellwig Signed-off-by: Mike Rapoport --- arch/arm/mm/mmu.c | 11 +++-------- arch/unicore32/mm/mmu.c | 12 ++++-------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 0a04c9a5..57de0dd 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -719,14 +719,9 @@ EXPORT_SYMBOL(phys_mem_access_prot); #define vectors_base() (vectors_high() ? 0xffff0000 : 0) -static void __init *early_alloc_aligned(unsigned long sz, unsigned long align) -{ - return memblock_alloc(sz, align); -} - static void __init *early_alloc(unsigned long sz) { - return early_alloc_aligned(sz, sz); + return memblock_alloc(sz, sz); } static void *__init late_alloc(unsigned long sz) @@ -998,7 +993,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr) if (!nr) return; - svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm)); + svm = memblock_alloc(sizeof(*svm) * nr, __alignof__(*svm)); for (md = io_desc; nr; md++, nr--) { create_mapping(md); @@ -1020,7 +1015,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size, struct vm_struct *vm; struct static_vm *svm; - svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm)); + svm = memblock_alloc(sizeof(*svm), __alignof__(*svm)); vm = &svm->vm; vm->addr = (void *)addr; diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c index 50d8c1a..a402192 100644 --- a/arch/unicore32/mm/mmu.c +++ b/arch/unicore32/mm/mmu.c @@ -141,16 +141,12 @@ static void __init build_mem_type_table(void) #define vectors_base() (vectors_high() ? 0xffff0000 : 0) -static void __init *early_alloc(unsigned long sz) -{ - return memblock_alloc(sz, sz); -} - static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot) { if (pmd_none(*pmd)) { - pte_t *pte = early_alloc(PTRS_PER_PTE * sizeof(pte_t)); + pte_t *pte = memblock_alloc(PTRS_PER_PTE * sizeof(pte_t), + PTRS_PER_PTE * sizeof(pte_t)); __pmd_populate(pmd, __pa(pte) | prot); } BUG_ON(pmd_bad(*pmd)); @@ -352,7 +348,7 @@ static void __init devicemaps_init(void) /* * Allocate the vector page early. */ - vectors = early_alloc(PAGE_SIZE); + vectors = memblock_alloc(PAGE_SIZE, PAGE_SIZE); for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) pmd_clear(pmd_off_k(addr)); @@ -429,7 +425,7 @@ void __init paging_init(void) top_pmd = pmd_off_k(0xffff0000); /* allocate the zero page. */ - zero_page = early_alloc(PAGE_SIZE); + zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE); bootmem_init();