Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10537633imu; Mon, 31 Dec 2018 01:32:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VYdex/o0dQitd++Ysjf6SNknGq8YzevrVWXkGI8XdbJsQv34JwTdIp+SCSdVaKyS4cveV X-Received: by 2002:a17:902:6b09:: with SMTP id o9mr36540388plk.208.1546248777404; Mon, 31 Dec 2018 01:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546248777; cv=none; d=google.com; s=arc-20160816; b=drkP1t+vk1m+kWa4P9KZ513o4VdWn3Z7pu7ld/43EQ2JQtFNfUPgqMORTc4Lt+4I54 uDStU3Gb6Kq504N3tCUosl970VnTKbO1Mj1m43IC3CJu6A8XSQgYaIBx8/fkdknZqbi8 JkO3EvXxmwuQ6poOnuSxYbmlE/Uvi+otBiuxOyShFtx9C7ryRV2VLaZJSjL2MoYhCWr/ 4mqK2+7MBFBAdbnzklCIJw/8azGYqvC9BacysuKJXkBWWyZKsoTE7iWsPk8IiPtTAwS0 K3rgsEkwh6lsosrBHteGt2gQEw6BfAZkjg12WfP5Q+5m0V/dGBUbfS9NTYC/ZEtapYet TY6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=2wd0Qil7Gi4posxidfpdhciLNNbiUAz+Ir2Rvnm7TKk=; b=1CniJw9krUwJyk6BZLcxZWeqsI7mEPK9s8+znxo9At1pMZDKbZxBJDdIsYF7y7OZDu x+IGg8sPaLnMlPyW5Om8Cd7ZjYiqOoc3czAV0TJLZsR6hcK16urjhAuoUaoaqJFNGJk6 wg5bGPG2/Pn+/niGIhvwA34iZtk4NHSTogCPVcs5qmjZlibxH4ImWgOprJAjxDC/wDM7 3oUY/OoKne/F9Qoi02lwWh9nNelPdY+eq5WfIkp35/yxfgWLUaJfKQHUHmVqHt6jN68+ G2fZBS7VW1Z9O6ZFgq1WQhTRQAl2hKwKv+tQOkq1fKRuD7S1/7bmdESyCGL0d9gzI3PX +Ajw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si1979244pgi.531.2018.12.31.01.32.41; Mon, 31 Dec 2018 01:32:57 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727301AbeLaJaO (ORCPT + 99 others); Mon, 31 Dec 2018 04:30:14 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:32884 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727284AbeLaJaM (ORCPT ); Mon, 31 Dec 2018 04:30:12 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBV9Sixp017039 for ; Mon, 31 Dec 2018 04:30:12 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pqftghdw2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 31 Dec 2018 04:30:12 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 31 Dec 2018 09:30:09 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 31 Dec 2018 09:30:01 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBV9U0sC8585524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Dec 2018 09:30:00 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85A674C044; Mon, 31 Dec 2018 09:30:00 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C8A934C040; Mon, 31 Dec 2018 09:29:56 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.181]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 31 Dec 2018 09:29:56 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 31 Dec 2018 11:29:56 +0200 From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Benjamin Herrenschmidt , "David S. Miller" , Guan Xuetao , Greentime Hu , Heiko Carstens , Jonas Bonn , Martin Schwidefsky , 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-s390@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, Mike Rapoport Subject: [PATCH v4 6/6] arm, s390, unicore32: remove oneliner wrappers for memblock_alloc() Date: Mon, 31 Dec 2018 11:29:26 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546248566-14910-1-git-send-email-rppt@linux.ibm.com> References: <1546248566-14910-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18123109-0020-0000-0000-000002FE365B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18123109-0021-0000-0000-0000214E6FCE Message-Id: <1546248566-14910-7-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-31_06:,, 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-1812310088 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arm, s390 and unicore32 use 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/s390/numa/numa.c | 10 +--------- arch/unicore32/mm/mmu.c | 12 ++++-------- 3 files changed, 8 insertions(+), 25 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/s390/numa/numa.c b/arch/s390/numa/numa.c index 2281a88..2d1271e 100644 --- a/arch/s390/numa/numa.c +++ b/arch/s390/numa/numa.c @@ -58,14 +58,6 @@ EXPORT_SYMBOL(__node_distance); int numa_debug_enabled; /* - * alloc_node_data() - Allocate node data - */ -static __init pg_data_t *alloc_node_data(void) -{ - return memblock_alloc(sizeof(pg_data_t), 8); -} - -/* * numa_setup_memory() - Assign bootmem to nodes * * The memory is first added to memblock without any respect to nodes. @@ -101,7 +93,7 @@ static void __init numa_setup_memory(void) /* Allocate and fill out node_data */ for (nid = 0; nid < MAX_NUMNODES; nid++) - NODE_DATA(nid) = alloc_node_data(); + NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8); for_each_online_node(nid) { unsigned long start_pfn, end_pfn; 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(); -- 2.7.4