Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp125052imj; Thu, 14 Feb 2019 16:51:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IZV/pQKw6ev8vaITOodiFMMlPwLxg5TWAwpqakZBs3yfSK6d4X/AQjrrM1troZWCzqxwGkJ X-Received: by 2002:a62:345:: with SMTP id 66mr6953297pfd.189.1550191860602; Thu, 14 Feb 2019 16:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550191860; cv=none; d=google.com; s=arc-20160816; b=JW7USv01W8hNBpfVPCAgIOUAFOxP/16sJKmcZchKoASmEhGpAaWo+VS1hEQYHkP5WA 5ZRfdkhT6ckuZy0yzmEdySEbTME4F9IWegqcs0Cx8VPhGKvBgQSKvheYiib034h63zkV 6s2kVFkU5NqXzERFnWtSS0y+JAy95l0rjc1/JmmWaG8LArlkhRhzOgt0WGKyM8Ruu2JH fehGGh85MpTHvSlQGneDAkNsDR1lqCNA2H+HLD4en97EJRzaZn8oQtS6IrREH/+qGTPK QO63pNFYgwI7u4YGXb2K+NqCa2NLnseCHcZNrH7qT5aCnpdpjksSivBK1tRU5g6QdCBC Vngg== 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=k9VZwu9YWjzbRtHwba6ia+DxawlSg12+yWxnAGjsdwM=; b=abTFgV1JNkBbFaS30DMaMGQtWfXmFxdL2UFjyEr59FC5J63RbxgBc6X0OypdudP7b8 77oOECGq3NA7hkEPXyBbkKJqCtMOO/Imj/qf51YBC+5kfAclhyO0Nh84HCuLsKYv14w1 uzwDu+hSuL34I+WS0PGcQWDPbZ0hw6AHTRTI7KgqlaL9KUHVyZS8FKVIB2cNh12ZoGBt NZlYKlAtYSMiJjYF6lzuiVBo7PiwMsdFhK4wr983xfz149g3piYDcX6PmG+/kHc1MYv3 bl8jL8W8q/s2R/UNcrmBbY6wnoFrVisd7Zp97ZLzahn30KEgYvxq96LrqFZyTI2adDWR 1qFg== 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 t24si3468159pgv.66.2019.02.14.16.50.45; Thu, 14 Feb 2019 16:51:00 -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 S2395186AbfBNP7x (ORCPT + 99 others); Thu, 14 Feb 2019 10:59:53 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48594 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730784AbfBNP7v (ORCPT ); Thu, 14 Feb 2019 10:59:51 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFgr7D104080 for ; Thu, 14 Feb 2019 10:59:50 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qnavjatpp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:49 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:47 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) 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) Thu, 14 Feb 2019 15:59:44 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxhpd7602456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Feb 2019 15:59:43 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C95AAE051; Thu, 14 Feb 2019 15:59:43 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55394AE053; Thu, 14 Feb 2019 15:59:41 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Feb 2019 15:59:41 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:40 +0200 From: Mike Rapoport To: Andrew Morton Cc: Christoph Hellwig , Palmer Dabbelt , Richard Kuo , linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport Subject: [PATCH 1/4] init: provide a generic free_initmem implementation Date: Thu, 14 Feb 2019 17:59:34 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-4275-0000-0000-0000030F8541 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-4276-0000-0000-0000381DA1A3 Message-Id: <1550159977-8949-2-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-14_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=726 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For most architectures free_initmem just a wrapper for the same free_initmem_default(-1) call. Provide that as a generic implementation marked __weak. Signed-off-by: Mike Rapoport --- arch/alpha/mm/init.c | 6 ------ arch/arc/mm/init.c | 8 -------- arch/c6x/mm/init.c | 5 ----- arch/h8300/mm/init.c | 6 ------ arch/microblaze/mm/init.c | 5 ----- arch/nds32/mm/init.c | 5 ----- arch/nios2/mm/init.c | 5 ----- arch/openrisc/mm/init.c | 5 ----- arch/sh/mm/init.c | 5 ----- arch/unicore32/mm/init.c | 5 ----- arch/xtensa/mm/init.c | 5 ----- init/main.c | 5 +++++ 12 files changed, 5 insertions(+), 60 deletions(-) diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index a42fc5c..8a8ac09 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c @@ -286,12 +286,6 @@ mem_init(void) mem_init_print_info(NULL); } -void -free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index e1ab2d7..1d08736 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -207,14 +207,6 @@ void __init mem_init(void) mem_init_print_info(NULL); } -/* - * free_initmem: Free all the __init memory. - */ -void __ref free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void __init free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c index af5ada0..ca1c182 100644 --- a/arch/c6x/mm/init.c +++ b/arch/c6x/mm/init.c @@ -73,8 +73,3 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void __init free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c index 6519252..fabf9e3 100644 --- a/arch/h8300/mm/init.c +++ b/arch/h8300/mm/init.c @@ -108,9 +108,3 @@ void free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void -free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index b17fd8a..4d6fa630 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -193,11 +193,6 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -void free_initmem(void) -{ - free_initmem_default(-1); -} - void __init mem_init(void) { high_memory = (void *)__va(memory_start + lowmem_size - 1); diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c index 253f79f..8a1563e 100644 --- a/arch/nds32/mm/init.c +++ b/arch/nds32/mm/init.c @@ -244,11 +244,6 @@ void __init mem_init(void) return; } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c index 16cea57..362a7a7 100644 --- a/arch/nios2/mm/init.c +++ b/arch/nios2/mm/init.c @@ -89,11 +89,6 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) } #endif -void __ref free_initmem(void) -{ - free_initmem_default(-1); -} - #define __page_aligned(order) __aligned(PAGE_SIZE << (order)) pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index d157310..bf3a160 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -227,8 +227,3 @@ void free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index a8e5c0e..bc59332 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -405,11 +405,6 @@ void __init mem_init(void) mem_init_done = 1; } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index 85ef2c6..3aed4d5 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -312,11 +312,6 @@ void __init mem_init(void) } } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD static int keep_initrd; diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index d498610..b51746f 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -216,11 +216,6 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -void free_initmem(void) -{ - free_initmem_default(-1); -} - static void __init parse_memmap_one(char *p) { char *oldp; diff --git a/init/main.c b/init/main.c index c86a1c8..38d69e0 100644 --- a/init/main.c +++ b/init/main.c @@ -1047,6 +1047,11 @@ static inline void mark_readonly(void) } #endif +void __weak free_initmem(void) +{ + free_initmem_default(-1); +} + static int __ref kernel_init(void *unused) { int ret; -- 2.7.4