Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp636737iog; Mon, 13 Jun 2022 09:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbaWBu89wuplUvEIwU0dhQx92TuD//PiVz+EOLEdja6bkmpyITjXbfRRHjqGjRMFksPdEg X-Received: by 2002:a05:6402:485:b0:433:2dfc:e886 with SMTP id k5-20020a056402048500b004332dfce886mr631957edv.241.1655138206539; Mon, 13 Jun 2022 09:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655138206; cv=none; d=google.com; s=arc-20160816; b=VSUeyk+7dPfn/QAnuYJjJ2ZhXwTpJe2d8Rov/J/avE9g1iRq6KEYkt1UPk9wTgipZd ogzXckQ1m/+bbFgOXPMzMpStB5ng04ke047Fy04+MODfrXRPpx5wp9BBf8VlBdZNskIF XkjvTrQwFoIyh6Tpbo4qu7fIvlaeb7Rs8YYgh9sLz3Dk99pvVZ8cRI1uomxDmlR2xHYe 78d6DgXPO67KqqvFpk4WZuo/vTE0xjY8LpudmE8n3pxzr+0ofVHB46ObBeO9bgsS3e3j 8CU88lBgIzi79jHekOOTiNcgzZIfTRXgcrWSW1IOsryb8i/6wY+l2BISY7RcNiPD4zyy ecIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QyHDP9EsF3JvMPY6OMVGqug3qZRp7px8bwfXf/FQIYo=; b=zjuw8OJTiXryw3JDubZGVAGLzYM8rubjENzcEc0dLWEKJtT2Hn1ZqrzcJO2L81GIB4 CN5jbQwW8NUeg5o0K+gPgxE9O8kH0W2nXOPahoJ3A9AIRey+QiyWjRzPqgx6oUpzas6+ vo9ctseuM3Z6RqIgC8JeGNwnlccactpSbLfeBu8/ArxBvEjx2Vdzc1RXMnKBhrmLD1Vt GJe88jKw/4cFYqCkg28JRtR/s2THo+J+MUwkXRs++M8NB95jgpq1oJrst2KjEoSHMve8 qNjN3yJXQOeCGfqFECjOZ4NqX2LG8Gui/nFCDOSfcgwAuQ3xl6IKxPd9Mg2UQrZbXIZ5 7mLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t26Okkmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a509e85000000b0042aaec01a46si8444239edf.462.2022.06.13.09.36.21; Mon, 13 Jun 2022 09:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t26Okkmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381312AbiFMOKu (ORCPT + 99 others); Mon, 13 Jun 2022 10:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381238AbiFMOEN (ORCPT ); Mon, 13 Jun 2022 10:04:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1946191573; Mon, 13 Jun 2022 04:38:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A49D461236; Mon, 13 Jun 2022 11:38:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5232C34114; Mon, 13 Jun 2022 11:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655120336; bh=0e/cvBWL0SQpVgWEmHUAiDpnBvCgvyOH05nsmtQ4huM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t26OkkmzmoP9Rgzyui4+Vjj5aviMVLfajgHiCjkUaIYyPPrOFwjtLWcfPZJQ8/rP2 8miYmthmSQcaaiwQcuvXJeU6bg6zcSuP56r9LkHUYCKYt2WyAF2l/Rwj/6YIcKde2N IA+a0kr3eGD4uWgpnHD74M2yhBZTV2tjHksbHKmE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" Subject: [PATCH 5.18 336/339] random: mark bootloader randomness code as __init Date: Mon, 13 Jun 2022 12:12:41 +0200 Message-Id: <20220613094936.925243258@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094926.497929857@linuxfoundation.org> References: <20220613094926.497929857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Jason A. Donenfeld" commit 39e0f991a62ed5efabd20711a7b6e7da92603170 upstream. add_bootloader_randomness() and the variables it touches are only used during __init and not after, so mark these as __init. At the same time, unexport this, since it's only called by other __init code that's built-in. Cc: stable@vger.kernel.org Fixes: 428826f5358c ("fdt: add support for rng-seed") Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 7 +++---- include/linux/random.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -793,8 +793,8 @@ static void __cold _credit_init_bits(siz * **********************************************************************/ -static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); -static bool trust_bootloader __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER); +static bool trust_cpu __initdata = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); +static bool trust_bootloader __initdata = IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER); static int __init parse_trust_cpu(char *arg) { return kstrtobool(arg, &trust_cpu); @@ -890,13 +890,12 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_random * Handle random seed passed by bootloader, and credit it if * CONFIG_RANDOM_TRUST_BOOTLOADER is set. */ -void __cold add_bootloader_randomness(const void *buf, size_t len) +void __init add_bootloader_randomness(const void *buf, size_t len) { mix_pool_bytes(buf, len); if (trust_bootloader) credit_init_bits(len * 8); } -EXPORT_SYMBOL_GPL(add_bootloader_randomness); #if IS_ENABLED(CONFIG_VMGENID) static BLOCKING_NOTIFIER_HEAD(vmfork_chain); --- a/include/linux/random.h +++ b/include/linux/random.h @@ -13,7 +13,7 @@ struct notifier_block; void add_device_randomness(const void *buf, size_t len); -void add_bootloader_randomness(const void *buf, size_t len); +void __init add_bootloader_randomness(const void *buf, size_t len); void add_input_randomness(unsigned int type, unsigned int code, unsigned int value) __latent_entropy; void add_interrupt_randomness(int irq) __latent_entropy;