Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6144860iog; Thu, 23 Jun 2022 12:16:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQRS7AK05Cfhh9Wzv8iU0sdR7sht1wTYICrCjuXNYhaTJntiyJybUqEwhyBmum9fMhz1jT X-Received: by 2002:a17:906:d552:b0:722:f0c9:1e2f with SMTP id cr18-20020a170906d55200b00722f0c91e2fmr9569979ejc.406.1656011782519; Thu, 23 Jun 2022 12:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011782; cv=none; d=google.com; s=arc-20160816; b=P7AeP1itOenaDF81e0ohiMTFhkCcj35tVumsyZzh5eOuKpiL+rb3G/DeTUUZkC0TgT jDYhKIpOAFy96s686o7VjnVxsL/NS6RA121Tt4896PNchXmW3mhf8ZhHq5+6vbpu8+oB TQHSBly5/ELgo1vODUBiCF70pz+4whvaiObuLC0qCXZRAaacPOsDMNGk8OrkVZBhlSrK +8K1bO+37kp5OGHylASl20RrnRMxsPn13DOGZBnUmnDfHSHppQkUC2zFJGgiR/StK4tF +CNLfhW/2zZnWvmt7BgXLbx1vp9FODAFQtQjl1RNncNQ+qo9rCDy1MMIx3pA3QMHZ6rM MC7w== 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=vHB71ci7w4GuH+7Eu/WeEp8dRTMMBuiQ/7XN0V3Rdt8=; b=IuUFZZV6JipvBWRN9oBOnMVOGEgmIavNUOVvDvoSoVbxt/18X/0gVS0k+j6HsCuZoi 1S74wFuzvF4WRC04Nv03xPph5tT3xPInsViYntOhtz6YmFqBXPHwPtXsaOjfPGulkuwU tCW+T7js3eljJxCOX7WgmIt5Q+7UneEgg4+BnKEhHijmj02TpmRKT8mTjazxWZvHRGKX CWDpxflzTl2TAdjVzDBHOAgQIrqsAvWE1GY/9z0Vz1IvlzIvvahy18tUZBQNunNK+3Bb 56qwtRrRQ7lt5xGrE3HdyNIJ2o7EYIJan41WpxEKrVZwaT9RCBLabf1Ku0EpeKqfc6C0 Q+rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DfwJ0Uxz; 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 i27-20020a170906265b00b00715867834e2si18400047ejc.499.2022.06.23.12.15.57; Thu, 23 Jun 2022 12:16:22 -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=DfwJ0Uxz; 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 S232563AbiFWR7d (ORCPT + 99 others); Thu, 23 Jun 2022 13:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbiFWR4H (ORCPT ); Thu, 23 Jun 2022 13:56:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2611AAE98D; Thu, 23 Jun 2022 10:15:29 -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 ABCDEB8249B; Thu, 23 Jun 2022 17:15:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BBA5C3411B; Thu, 23 Jun 2022 17:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004526; bh=aOprigIcG/hpSAFQqHtR2NrqFIOQ6+qE+2D3VkQdaoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DfwJ0Uxz1RbPhhyJ5tpRjrsrjNRdXxEB2TeVNtwEbaimTT7Bc7PveA2Tbet1aNaLg AJXQR+2T3QLYZUDIcAn4tz9T2iNy+ZFCg0bbEJNkUVmzBfn7qe/DUk2ogLb0FGYF9W BBV8d+LvfNA/oQ1K0b5NfRNpJDLPVn2gwCtUaxpY= 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 064/234] random: remove unused extract_entropy() reserved argument Date: Thu, 23 Jun 2022 18:42:11 +0200 Message-Id: <20220623164344.873552454@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 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 @@ -519,7 +519,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); @@ -989,7 +989,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 { @@ -1327,8 +1327,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; @@ -1342,7 +1341,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) @@ -1448,15 +1447,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); }