Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6053087iog; Thu, 23 Jun 2022 10:19:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyCZ/n/psfDuOCenQxKW0Zth13spmFxePXC3w867NJ9PEnoTa+40tholWuWUXOumf6AuQZ X-Received: by 2002:a17:907:217b:b0:722:fc5e:326e with SMTP id rl27-20020a170907217b00b00722fc5e326emr6157397ejb.478.1656004787703; Thu, 23 Jun 2022 10:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656004787; cv=none; d=google.com; s=arc-20160816; b=kt/rKS4wsLlCkhDkCIR4avJfP8Z6o9PP2kdR+5xFP6+N7joyT1WbAHlFimswP/V+4b a0cGvM8PvtPHD/c5cLN6D62fUiaHxjZjQP/5xcEwa9epcvbRwZShT3Fv33a6GMQ2H8rd 9Sledbvr3KqtCi/xouqZX+7XXGavTiK+rHdXH8TwzOyKKjcsewf3e5/97OcuOh40NYRK ZtPdOQPRtvJH4+RiQQhx0JmhRVZ4WDPbeBmbIZoauPgbQgouhKnLqgGc80M+EUw0o5Vi ONpDhP//7j92WAYM2MAxAc8qoO/k7CEeLqfhOcqg/qxzWfW5o+3xidoZch/LOyrJnj5o 423A== 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=DUIS2a7i5gz/eL4Dl+sHv71FRQ2swnMS/DQMny0Ohrs=; b=pMUvCWkhFHyxZ3W5ZH0xHoNDsTp8FFc1+cWfZFpIN7tJR+ocM8hBNuTH99svsoOiGW EajCkW7tA2ED4H+5ivQvPJdCMfK72a52e7B1OYM20V2u+0YEhgs+I0hKpePXAOub54PD 8tsZ39gwJ8EJfGaszgootUDDot4+0fwwgvSFMBMbEvO1XokMAj8eFanKFNxNYYXNkPIU 1vdIEnVpueGPXt9ab+cRTxG8uyECqQI5UiToq2iSAx0dC67/Tfi8AqdzIfIN9nP+3DE3 Zm7yBHiB3imnxHbDZbeU1JEdbq4bcyHJmFtfa9S7iwE6OrJA1afwAY2AAws0feWFUftn pHyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tl4jMlxM; 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 nb19-20020a1709071c9300b006e82f2c77cfsi10353139ejc.199.2022.06.23.10.19.16; Thu, 23 Jun 2022 10:19:47 -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=Tl4jMlxM; 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 S231670AbiFWRKI (ORCPT + 99 others); Thu, 23 Jun 2022 13:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233455AbiFWRHq (ORCPT ); Thu, 23 Jun 2022 13:07:46 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162B241FA9; Thu, 23 Jun 2022 09:56:32 -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 sin.source.kernel.org (Postfix) with ESMTPS id 21B7CCE25DE; Thu, 23 Jun 2022 16:56:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E6F3C3411B; Thu, 23 Jun 2022 16:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003387; bh=h34P58f9Q7rMv+SuUnRTaL3Vhx5/d6EkWsnS64CucmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tl4jMlxMKksracN0kpqJ7f2sI4oxPoKYOvRkmBSAQNMeP4DZg8UZQaTzaF+ebMM0p w0kw6TO7WOnUMqvGU1mgD2HrG7v4f9nngyrJ0g7WN6Nf1AMR53SAiuLSljkifIQ1X+ 73Vew6n76xk6OQ82B5UYyDsr8gt2coi/XtMajyh8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" Subject: [PATCH 4.9 223/264] random: mark bootloader randomness code as __init Date: Thu, 23 Jun 2022 18:43:36 +0200 Message-Id: <20220623164350.388542443@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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 @@ -786,8 +786,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); @@ -883,13 +883,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;