Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6144561iog; Thu, 23 Jun 2022 12:16:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t/sH4N5bAYYid6nJte5jQDUihWSA6eeW+sv9mG+cgs2dTkaM1v64KuKinhOcZhjPUWV2iB X-Received: by 2002:a17:90a:12c9:b0:1ec:8b01:cec2 with SMTP id b9-20020a17090a12c900b001ec8b01cec2mr5706423pjg.42.1656011765340; Thu, 23 Jun 2022 12:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011765; cv=none; d=google.com; s=arc-20160816; b=C3BTqFYrM3LQ9JmdUSUzyzIb9zUmqm91JP8TEGuQddr1ZXmstZE1w3ay5LQNWXXFKG yF3sRO7wOPdrJFM1D7ZjU3xh/j7I4OXVgr/Fb82Zi7+TgWF5j3j5swnIdlutEqGPAvGV dMwGyMyVOFGEjJpoP305WTw3RgaaOv6HHxodFMWJRXZWqpdAIYN6GavICOWlh1sopwZS Io/5Ksibvi/lU2UAcMZu9ED91O5YBk4lV90ab1al7nJDylXcYqm+TfZ6k2IWo0orQ3N7 EdjyAhjwotKP3wzDcMkrpX9ayJwz6cGRB7j/9Tp7QcTuz9/3/FX4NN1SQzgwlUtRHPXd kWkg== 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=VjYFfCP/Pp8GFvP711bnLZLaKr/hAd0j/YwSZ97YDvc=; b=vPGvv9e8kOUoLYYDktUSz4hkTMEnLRI2vIyA7IeepZSxM0gqu5CwvPtdOa1SY9oqQ7 kGYSkOpChhtTSiWw1lHLrJF3NHgg89flXgMgsCyDpN95GLc7Ops+mU2B+PHmcVVFHbta 2mCXUuXlSSTiI8Cy51zb9XwQbG0KroZwoCc7kyA3Hz6FYaOE4TKp89k3BMQSx8XoqpW5 d0br6LyGat4X56vOyWUENVDHF2biqC9nCLCUb/d+XWQdZnjd9FCGIfFoA/cpqZPr8Aka LNqdzvbS7HfpNJCnqungZ+E4o3UPs5LOekawHB6Jxy6zaklCBCqQRZQyngPrHqeGK5rU 4Fqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x0UVte4d; 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 d188-20020a6236c5000000b0052545059695si223335pfa.307.2022.06.23.12.15.53; Thu, 23 Jun 2022 12:16:05 -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=x0UVte4d; 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 S236518AbiFWSPA (ORCPT + 99 others); Thu, 23 Jun 2022 14:15:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236554AbiFWSN5 (ORCPT ); Thu, 23 Jun 2022 14:13:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DBB09A872; Thu, 23 Jun 2022 10:21:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id 93279B82490; Thu, 23 Jun 2022 17:21:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05743C3411B; Thu, 23 Jun 2022 17:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004875; bh=0FJWfLoW8P5fpPUhXZhjrPk7ihopk+wbSWD3MHtf1pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x0UVte4dIurJvl4wlVoWpzrDVbxpRurFDbhRA/IVBOqJ/cBYUxlZegCCFBk2yyOQn xjwm1ln4bE26/AWaZGbx0zbDgzmHRpeDo+t09vH3Pz7FsdFuvLCpfcll+P3q3E/UD7 PdK9lBycg8kUG+AwPqdn3oiqq2Kh6RMZENkIP0DM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" Subject: [PATCH 4.19 179/234] random: mark bootloader randomness code as __init Date: Thu, 23 Jun 2022 18:44:06 +0200 Message-Id: <20220623164348.116591469@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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=-7.7 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 @@ -785,8 +785,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); @@ -882,13 +882,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); struct fast_pool { struct work_struct mix; --- 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;