From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753572AbeDAPAJ (ORCPT ); Sun, 1 Apr 2018 11:00:09 -0400 Received: from smtprelay0036.hostedemail.com ([216.40.44.36]:54936 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753519AbeDAPAI (ORCPT ); Sun, 1 Apr 2018 11:00:08 -0400 X-Session-Marker: 7368656140736865616C6576792E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,,:::::,RULES_HIT:41:355:379:541:800:960:965:966:973:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:1978:1981:2194:2196:2199:2200:2393:2559:2562:2892:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:4321:4385:4390:4395:4605:5007:6261:10004:10848:11026:11473:11658:11914:12555:12895:13069:13149:13161:13229:13230:13311:13357:14096:14181:14384:14394:14721:21080:21433:21451:21627:30012:30054:30056:30075,0,RBL:71.235.10.46:@shealevy.com:.lbl8.mailshell.net-62.14.0.191 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none X-HE-Tag: match19_7561532018e08 X-Filterd-Recvd-Size: 1981 From: Shea Levy To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shea Levy Subject: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem. Date: Sun, 1 Apr 2018 10:59:15 -0400 Message-Id: <20180401145931.7932-1-shea@shealevy.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180329113207.30674-1-shea@shealevy.com> References: <20180329113207.30674-1-shea@shealevy.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function is effectively identical across 14 architectures, and the generic implementation is small enough to be negligible in the architectures that do override it. Many of the remaining divergent implementations can be included in the common code path in future, further reducing code duplication and sharing improvements between architectures. Series boot-tested on RISC-V (which now uses the generic implementation) and x86_64 (which doesn't). v6: Add information about build/run testing. v5: Add more complete commit messages. v4: Use weak symbols instead of Kconfig. v3: Make the generic path opt-out instead of opt-in. v2: Mark generic free_initrd_mem __init. Signed-off-by: Shea Levy --- init/initramfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/initramfs.c b/init/initramfs.c index 7e99a0038942..c8fe150f958a 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size; #include #include +void __init __weak free_initrd_mem(unsigned long start, unsigned long end) +{ + free_reserved_area((void *)start, (void *)end, -1, "initrd"); +} + static void __init free_initrd(void) { #ifdef CONFIG_KEXEC_CORE -- 2.16.2