Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6031873iog; Thu, 23 Jun 2022 09:57:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vwl/c+Zuj00FgFRxpbvfabtNb7mYnMdTNnxfksnMUwFK8RtyNcre09K7LS0oCc6hq59KUg X-Received: by 2002:a05:6402:3224:b0:435:80fd:333 with SMTP id g36-20020a056402322400b0043580fd0333mr12065259eda.76.1656003432232; Thu, 23 Jun 2022 09:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656003432; cv=none; d=google.com; s=arc-20160816; b=v4ciAjqv+lEn7zhB8jtvC2v5EBV/fihPR6gp/KUOPPH2Ibm7V2pbRmVPHoBvGfas/4 EaBhdHaEWemcZWnQjskDrvmQDqNGipMZwAFHjFenj2CMrLVgRD91KMwqEjKRI6blh71/ 55JZ6tcP9kywkB3S8+yuE9naYrEsUnijMc0ZU+fDTULMCknlmJ0WSK+qzzjvwDPoHcAY HdV3finNRuok9C/VstyKpb+xjM1XupDicaf+BwPDm7XzTS9b3oLBVgDxWNPd1q8qS+89 bmNZAtxyixF0GxkPLz8Zlh4rXwljEoUXwriRcaCDWGQ+XKmvkOUU1FeErwd/CEHDasgg OpXA== 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=DQuDElkLCnDnh0QcUjYXm9wndJRDJVYerM5thH3Z4gc=; b=jfyvQKqMVIoiUAVLM1WZ9eHbQ3PChVr4bOIF5L2wnbJhCkWoP6CGvSqzS+eTf8ry7d f2t913sewkaMAwNo1epr3shwVDG47yXK1tFD5wD/HgeVfTzx7LxmuiRaCISPmthudTYB v6s2z/5V/EpaYWZ/HG05qfPmsZefLML8MC70M9gsG/l0UTCEilkEHgDbSBPfAGnAQNdE DWe1FV6q34ictw5Rp0eMJvkcsoVvZD9OO3v0S5/4E310hYWP/616Qq9RrA4v68b/Qt1X gf7FWk0YEXUWWqyRhqVsTeYTMKo7/ZSbOliDJk0w4QRJEMnhmREEMG1boIQtF8soPoHG XUag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yja2CzhT; 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 h7-20020a056402280700b0042fb3bafedfsi91631ede.348.2022.06.23.09.56.39; Thu, 23 Jun 2022 09:57:12 -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=yja2CzhT; 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 S233161AbiFWQzF (ORCPT + 99 others); Thu, 23 Jun 2022 12:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233827AbiFWQvm (ORCPT ); Thu, 23 Jun 2022 12:51:42 -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 7898726E; Thu, 23 Jun 2022 09:50:04 -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 116AF61FBF; Thu, 23 Jun 2022 16:50:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9ED5C3411B; Thu, 23 Jun 2022 16:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003003; bh=h1bjvM96JzGywRTAxnqE/UXeEAEJfaDbTKnjk3kRPJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yja2CzhTi1Ug9+TDKE9xu2d/hsQjSW/eeShNIvpQVFW6Nil6qROxh4aCNh3cxFsEP zqGhIX6WJ+qx4R43HrB3yz6RBUdyqOvEgKT367z4NZKKCy3EPaR5Nwgjglv/c9V/fi ZFJWqA2DSN87UUzMMYPgRHfiswLktRzaiaHCu4nk= 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.9 098/264] random: remove unused extract_entropy() reserved argument Date: Thu, 23 Jun 2022 18:41:31 +0200 Message-Id: <20220623164346.844388258@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 8b2d953b91e7f60200c24067ab17b77cc7bfd0d4 upstream. This argument is always set to zero, as a result of us not caring about keeping a certain amount reserved in the pool these days. So just remove it and cleanup the function signatures. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -520,7 +520,7 @@ struct entropy_store { }; static ssize_t extract_entropy(struct entropy_store *r, void *buf, - size_t nbytes, int min, int rsvd); + size_t nbytes, int min); static ssize_t _extract_entropy(struct entropy_store *r, void *buf, size_t nbytes); @@ -1040,7 +1040,7 @@ static void crng_reseed(struct crng_stat } buf; if (r) { - num = extract_entropy(r, &buf, 32, 16, 0); + num = extract_entropy(r, &buf, 32, 16); if (num == 0) return; } else { @@ -1378,8 +1378,7 @@ EXPORT_SYMBOL_GPL(add_disk_randomness); * This function decides how many bytes to actually take from the * given pool, and also debits the entropy count accordingly. */ -static size_t account(struct entropy_store *r, size_t nbytes, int min, - int reserved) +static size_t account(struct entropy_store *r, size_t nbytes, int min) { int entropy_count, orig, have_bytes; size_t ibytes, nfrac; @@ -1393,7 +1392,7 @@ retry: /* never pull more than available */ have_bytes = entropy_count >> (ENTROPY_SHIFT + 3); - if ((have_bytes -= reserved) < 0) + if (have_bytes < 0) have_bytes = 0; ibytes = min_t(size_t, ibytes, have_bytes); if (ibytes < min) @@ -1499,15 +1498,13 @@ static ssize_t _extract_entropy(struct e * returns it in a buffer. * * The min parameter specifies the minimum amount we can pull before - * failing to avoid races that defeat catastrophic reseeding while the - * reserved parameter indicates how much entropy we must leave in the - * pool after each pull to avoid starving other readers. + * failing to avoid races that defeat catastrophic reseeding. */ static ssize_t extract_entropy(struct entropy_store *r, void *buf, - size_t nbytes, int min, int reserved) + size_t nbytes, int min) { trace_extract_entropy(r->name, nbytes, ENTROPY_BITS(r), _RET_IP_); - nbytes = account(r, nbytes, min, reserved); + nbytes = account(r, nbytes, min); return _extract_entropy(r, buf, nbytes); }