Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1981024ybh; Tue, 14 Jul 2020 12:12:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi2u5dbt4G5A2m7Gx/Gm7lvja118/aWCA2K7AeaK0f7hKrAtNxiPGBZ5Y94wEPJ9rvH9xr X-Received: by 2002:a05:6402:2c2:: with SMTP id b2mr6060647edx.184.1594753966518; Tue, 14 Jul 2020 12:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594753966; cv=none; d=google.com; s=arc-20160816; b=0m0bM0vodxjRcJDxWAXI+R+e18ljvwkNFGC3sBN1Gk8N/cTE3J0cECnmeA7EULBUMg dw/RVm/PyvEb6+hw9tLC8tKC+WRHM+JHemNihqF4XOiIoGVHpQ0cGHJnWDtdJsFIvnN8 oEdmnpzEKW1IKfE0HRJG17snNXhuUtyZLa3UxkvkoDNKh8F9hPdonEvFtL8F1dQ3ZI+1 7Ej8IiXbTgBSWTcnJAKntsJAaXZvOi5NaQpdK+Gg6qWjLd1sWyuqwDKuVh6wRMPZep6p Qw2LG6RdfyjkiDwJvKoTA4Ho4eismFIQi89Ea7HOSi4GvHJVheJafJ0aWWnuFIM80MQq EXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eSteiKXBs+T9nikVDk78jTHAmqowdgqYyArs87G/ivQ=; b=EsW96TB5kO8o2ZSSJ1WtLVNTJexg+nniwdH3nRxSgc2VnGX6IGQQEZEqhAmfUr/UU8 sFCFIKAulkPgYyAi/x4cw2jmlUd/haP4yxQRG6PaKhR5Zr6+NZnBOj8LtrXmfnVcDCjn fuDRUUpp1ouHizDpms8gUX6rbjkVWblUV1xWnS14igBDTlqfJ1wR2iqtAV0f9dV4QJFE jNdJVmiXY2VdqGgw8rPEHq5PQdKkA1VksNkRXm9I/fkoaETo7RrxzNhgQHls+E2CwxbA fXbYRysJlp7Xjt6+oL3xUyqWdgpQqS0nZ8q1vr4Wev3XxKkWMc2f3AG4lybzcW+N2ag6 4Pyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=FSklrbqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de21si11383728edb.510.2020.07.14.12.12.23; Tue, 14 Jul 2020 12:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=FSklrbqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731106AbgGNTKU (ORCPT + 99 others); Tue, 14 Jul 2020 15:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731382AbgGNTJM (ORCPT ); Tue, 14 Jul 2020 15:09:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5662DC061794; Tue, 14 Jul 2020 12:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=eSteiKXBs+T9nikVDk78jTHAmqowdgqYyArs87G/ivQ=; b=FSklrbqGKiY9nUjN1ULO+eLOkk RQOL+jNMzBceXGRMhWh64A5RSh7EzmQo2Ooe5wVh09PGfT5RAKNQRmUys/aFuckpUeE2yJXPsQ6bX RpJEOjv0tjnwVY9k40hrkgc808d64yATdgHq5qKfFB5Kv/twy/EURF616LrQl7bBrGpKXrofMbYkr N72rgNrHkHnC5L4KmNLlvq0HMbtSPvyf7Z1eVvyMewBWFD39pxPDcatWRHCXHi2Dp2e555vFPGMwq uiyPYdq4/cU9dNpSpXIwQ1LMbdNYnLuAhgis1g+DH6+DDYqIUn0jU12sUdaxzMBj8S6cz7fQecEwI hpc6vWYA==; Received: from [2001:4bb8:188:5f50:f037:8cfe:627e:7028] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvQIg-0005sz-HL; Tue, 14 Jul 2020 19:09:10 +0000 From: Christoph Hellwig To: linux-kernel@vger.kernel.org Cc: "H. Peter Anvin" , Song Liu , Al Viro , Linus Torvalds , linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 15/23] initramfs: remove the populate_initrd_image and clean_rootfs stubs Date: Tue, 14 Jul 2020 21:04:19 +0200 Message-Id: <20200714190427.4332-16-hch@lst.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714190427.4332-1-hch@lst.de> References: <20200714190427.4332-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If initrd support is not enable just print the warning directly instead of hiding the fact that we just failed behind two stub functions. Signed-off-by: Christoph Hellwig --- init/initramfs.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/init/initramfs.c b/init/initramfs.c index 7a38012e1af742..d10404625c31f0 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -618,13 +618,7 @@ static void __init clean_rootfs(void) ksys_close(fd); kfree(buf); } -#else -static inline void clean_rootfs(void) -{ -} -#endif /* CONFIG_BLK_DEV_RAM */ -#ifdef CONFIG_BLK_DEV_RAM static void __init populate_initrd_image(char *err) { ssize_t written; @@ -644,11 +638,6 @@ static void __init populate_initrd_image(char *err) written, initrd_end - initrd_start); ksys_close(fd); } -#else -static void __init populate_initrd_image(char *err) -{ - printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); -} #endif /* CONFIG_BLK_DEV_RAM */ static int __init populate_rootfs(void) @@ -668,8 +657,12 @@ static int __init populate_rootfs(void) err = unpack_to_rootfs((char *)initrd_start, initrd_end - initrd_start); if (err) { +#ifdef CONFIG_BLK_DEV_RAM clean_rootfs(); populate_initrd_image(err); +#else + printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); +#endif } done: -- 2.27.0