Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6146143iog; Thu, 23 Jun 2022 12:17:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uodH1D5NjurOXuzoVcfL4E90PxFqdOZMBG/HaqJdyb3+Dqwr53TwpM2D6E6HuWOVnqygx6 X-Received: by 2002:a17:902:76c1:b0:167:6ef7:dab4 with SMTP id j1-20020a17090276c100b001676ef7dab4mr39392011plt.146.1656011867922; Thu, 23 Jun 2022 12:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011867; cv=none; d=google.com; s=arc-20160816; b=SjnM1g/Ldcd9kEA1rVQezHlBtDQVsW/ek/ZH+fvxpBcp083MwM1H4U1ejtS7nqoB0r p4rOBD7g5qi9LJ0nzR5IRbQ1bTIkcasz1j5zLLFJdRrDJZ5dYl+8a0w6WhucT7gSzA9u G2prDytus/9G9IztSnUAIEI8I2pItDWxeuz4qtUJh2OzDzRdkmpDJMj6AxBE24xveYlr NxbclE4k179Obq2VOUEoKFQwaj3K40qX5VusOrXHE3l9GMJa4zn7YXrmGz92CAaOhi6c mjZG2VxpIvgk2csDtiWv2QRBjPfbajij5+TnXBJ5kkPdCXz8s56iZY4oFOjoFhD2yady O79A== 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=XO/+5PnKcCR+mvNLDOt2Hev635NIc6yT6TP0TZLmViQ=; b=Vsv5OYsX1Nd8tkuZO9P5GInvY7VuJ+6PVCKCtvPBIu9eqxmC/qzsvmuVi0AA3dTbjL BKvbplgn3Z6W6T/j6NrpxopWAvNUlmA0qyCRthNbSbu7/jkGMsWWRQqo4f8DPlUDwRdt Cd2vJYclfUEIEqV6dMsakbtgYxNozQp7II3iJwbpG8v3aK/a2kmj3qMsBrFjreEz0O7I qhgWyKTbIliu4mcMboq5FrHDGYuHYzs5qsH++0APfaLze0SpdrPHha6MmxLcprjaByod RjhqccCNUuzuIoacgJq09E/AwAaNhn3T/wDPAj4bhh33bzXV6dSKt87wpHbioHv57QpL yt3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdBTPJ0L; 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 f10-20020a056a001aca00b0050e0a0b03afsi30903100pfv.362.2022.06.23.12.17.35; Thu, 23 Jun 2022 12:17: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=fdBTPJ0L; 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 S235821AbiFWSA5 (ORCPT + 99 others); Thu, 23 Jun 2022 14:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235754AbiFWR5j (ORCPT ); Thu, 23 Jun 2022 13:57:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B41EDAE9B1; Thu, 23 Jun 2022 10:15:36 -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 3E91B61DEF; Thu, 23 Jun 2022 17:15:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0ECFCC3411B; Thu, 23 Jun 2022 17:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004535; bh=X3ndALqqFVENCzduf7i3wwpF2ta0OR/76HnniJRrl0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdBTPJ0LqHcOi8XZkV3ZqodSwugQUeLJgWFPXwmt+ZHyFMNtfsvP3XeCI+JA5vU0E oqteNed1JyWJakV752+OgB9IQbTV4oRp+m0stec0sofzf6AFJuj46Y7MlnKiBRrsma 3kJCND9E5UBJIEjLYWiwL6D146XjJSaDaS/LyvtE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dominik Brodowski , "Jason A. Donenfeld" Subject: [PATCH 4.19 067/234] random: de-duplicate INPUT_POOL constants Date: Thu, 23 Jun 2022 18:42:14 +0200 Message-Id: <20220623164344.957705512@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 5b87adf30f1464477169a1d653e9baf8c012bbfe upstream. We already had the POOL_* constants, so deduplicate the older INPUT_POOL ones. As well, fold EXTRACT_SIZE into the poolinfo enum, since it's related. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -359,13 +359,6 @@ /* #define ADD_INTERRUPT_BENCH */ /* - * Configuration information - */ -#define INPUT_POOL_SHIFT 12 -#define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) -#define EXTRACT_SIZE (BLAKE2S_HASH_SIZE / 2) - -/* * To allow fractional bits to be tracked, the entropy_count field is * denominated in units of 1/8th bits. * @@ -440,7 +433,9 @@ enum poolinfo { POOL_TAP2 = 76, POOL_TAP3 = 51, POOL_TAP4 = 25, - POOL_TAP5 = 1 + POOL_TAP5 = 1, + + EXTRACT_SIZE = BLAKE2S_HASH_SIZE / 2 }; /* @@ -503,7 +498,7 @@ MODULE_PARM_DESC(ratelimit_disable, "Dis * **********************************************************************/ -static u32 input_pool_data[INPUT_POOL_WORDS] __latent_entropy; +static u32 input_pool_data[POOL_WORDS] __latent_entropy; static struct { /* read-only data: */ @@ -1959,7 +1954,7 @@ SYSCALL_DEFINE3(getrandom, char __user * #include static int min_write_thresh; -static int max_write_thresh = INPUT_POOL_WORDS * 32; +static int max_write_thresh = POOL_BITS; static int random_min_urandom_seed = 60; static char sysctl_bootid[16]; @@ -2016,7 +2011,7 @@ static int proc_do_entropy(struct ctl_ta return proc_dointvec(&fake_table, write, buffer, lenp, ppos); } -static int sysctl_poolsize = INPUT_POOL_WORDS * 32; +static int sysctl_poolsize = POOL_BITS; extern struct ctl_table random_table[]; struct ctl_table random_table[] = { {