Received: by 10.213.65.68 with SMTP id h4csp1423294imn; Thu, 29 Mar 2018 04:38:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48XcW+lzkgcFEaWJ+qSnAor2X1Dah+dW8i/BqedPxxDZ4AJkU43rbshrcGKM386+iuRfYcm X-Received: by 10.167.128.2 with SMTP id j2mr6121832pfi.179.1522323485938; Thu, 29 Mar 2018 04:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522323485; cv=none; d=google.com; s=arc-20160816; b=EpC6d7fevWdBJeb4XqjQW+IJy7yzs2Pq9oB0uXLixO7n2v8nga9XNaA7dQkyNUHrwl viZdfUoyT94rwEqGHox564IMbXFS/fM+2c5NafDudHS3Fa7NGMXnfd7zD/zl9Bcgc5dF ckLhkGB/WE07x7I5lNgCVrB8PfHWI2XR9uOy0MB8XDYouS3668jOlGU5tiror7iC6sCx pQ+k8PQfPOLi8q2LhbTRALnt7EcnoesjR008oMauWlu6GZpJ7uwC60PqGqMd44U8tHFF /ZyeEZAgqEOzADFWWHGqwMFS039pCkU7tZGGJq6VPo6jW6jpoTlpM9Yk5g9TOB+4FK43 PMjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=pRwk6DIDdjGzRTFx4736RgiIBkkZvotDWLtHaM50D7M=; b=FYDMX2cW0K0+dcAGWr4X9hFILl9Y1GWOT9vQxxmVWMOCmjp1oryB+hjEYQ0oBfx8o5 o7qhjxjjGyEQHSA3/VS1oAPzFnlPKEuFdEI3XVPWqW1t3Z1gSrL1+v6HtqC1kJYq9/ZQ iqtujSKIuKjGq5nYjm68yPkz2Rg/4amPcLrwOwBiFemGkeX+fWkVlGIGc0IGBOlZloOU LGeQtRZs0vdzyhCASgnatZb2LO2g2CqPqLY2zPBLX+j77qTpb79ho55cvMA+lhM7JkiY q9FVROC8fPZis/dAD91NOBflzhlBb4NqhPJv/y9GJtCL148/Rkz0g9QHjvkUMMQImyaB 8R3Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b64si4255078pfa.328.2018.03.29.04.37.52; Thu, 29 Mar 2018 04:38:05 -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; 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 S1753105AbeC2Lcp (ORCPT + 99 others); Thu, 29 Mar 2018 07:32:45 -0400 Received: from smtprelay0037.hostedemail.com ([216.40.44.37]:52107 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752975AbeC2Lco (ORCPT ); Thu, 29 Mar 2018 07:32:44 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 3B33D182CED2A; Thu, 29 Mar 2018 11:32:43 +0000 (UTC) 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: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,0,RBL:71.235.10.46:@shealevy.com:.lbl8.mailshell.net-62.4.0.191 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ff,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:21,LUA_SUMMARY:none X-HE-Tag: knee35_17a473fa33b56 X-Filterd-Recvd-Size: 1831 Received: from localhost (c-71-235-10-46.hsd1.nh.comcast.net [71.235.10.46]) (Authenticated sender: shea@shealevy.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Thu, 29 Mar 2018 11:32:42 +0000 (UTC) From: Shea Levy To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shea Levy Subject: [PATCH v5 01/16] initrd: Add weakly-linked generic free_initrd_mem. Date: Thu, 29 Mar 2018 07:31:52 -0400 Message-Id: <20180329113207.30674-1-shea@shealevy.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180328203659.18692-1-shea@shealevy.com> References: <20180328203659.18692-1-shea@shealevy.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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. 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