Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2950886pxk; Mon, 21 Sep 2020 01:01:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZp2YClJKtlMwsn4xJPf+SmKzcYcSjkyMI116wBc73VpsiU42OvA8Vb2SaTp5pb7/W5PRJ X-Received: by 2002:aa7:cd90:: with SMTP id x16mr50104258edv.302.1600675262196; Mon, 21 Sep 2020 01:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600675262; cv=none; d=google.com; s=arc-20160816; b=pS69eDfATdaCg9icNO8Pbh9CJVu42fN0SyfwWQuHCY6kSRht5IdUv6j8o6otwoXdii jODLi1GgC1ZXVBbnZHr6ecuvaXpP0RD817mhJxeiQpGx+TPaf8MMi/nSc2Kn9Icy/Bbw u9zuL9xleTWAqqYFd8/TYa1UHRtzcvn1RkS6xPTyBdL25SipBAhxfG8hv4ulpmZI2AWi U/1VAETrctk0sRdOLlL4I8jWXdyOGMp9LoMsoHEbDQmjqitWO6wbNOqepl5fFv0uOaC4 wbeU3zED8u3gI6ijyGZBpZWlj8dH4EMioQ3YV6/QCNnqbxCDYWe3IPd16FxzGzGqgb/H H21w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=p2SZX+RYkYctE5Tm+z5rS5Vztx1S7V5zhG3EbAA6SCw=; b=aeMoXMqGdT+jPFjfi8wKsp4RAuIb86hqOzOijYvLEQmjEUDBIcf0VdpzdeX6eoxpsq GIibDVJjdCjnyjIfLPs4torgssLngErF41mO8HYGu7FLS7YKIMR0ALApwe8WOJqsxedi 86vsBvm0irxSKnAXG9zUCUzdb5nY1VNcZz7TtLWEyBZnHA8J0SN1jocaYIyqJODOY5/U /YAr2moTDIOty2QiT1ku3xs7766dzjIfM3AGiOMelLQ2QHh1f4BthoVWYk324tX0cau6 VfF0+WbEXJpW6PEIucWFPq2yjwrWlwIhxEdysldmmg7snOunq0XbhNTxt7ONYeErR+vV OtBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si7726625edo.12.2020.09.21.01.00.38; Mon, 21 Sep 2020 01:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726318AbgIUH7S (ORCPT + 99 others); Mon, 21 Sep 2020 03:59:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:56496 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgIUH7R (ORCPT ); Mon, 21 Sep 2020 03:59:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2C92AB4FB; Mon, 21 Sep 2020 07:59:51 +0000 (UTC) From: Nicolai Stange To: "Theodore Y. Ts'o" Cc: linux-crypto@vger.kernel.org, LKML , Arnd Bergmann , Greg Kroah-Hartman , "Eric W. Biederman" , "Alexander E. Patrakov" , "Ahmed S. Darwish" , Willy Tarreau , Matthew Garrett , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , Andy Lutomirski , Florian Weimer , Lennart Poettering , Peter Matthias , Marcelo Henrique Cerri , Roman Drahtmueller , Neil Horman , Randy Dunlap , Julia Lawall , Dan Carpenter , Andy Lavr , Eric Biggers , "Jason A. Donenfeld" , =?UTF-8?q?Stephan=20M=C3=BCller?= , Torsten Duwe , Petr Tesarik , Nicolai Stange Subject: [RFC PATCH 01/41] random: remove dead code in credit_entropy_bits() Date: Mon, 21 Sep 2020 09:58:17 +0200 Message-Id: <20200921075857.4424-2-nstange@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200921075857.4424-1-nstange@suse.de> References: <20200921075857.4424-1-nstange@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Since commit 90ea1c6436d2 ("random: remove the blocking pool") the local has_initialized in credit_entropy_bits() won't get set anymore and the corresponding if-clause became dead code. Remove it as well as the has_initialized variable itself from credit_entropy_bits(). Signed-off-by: Nicolai Stange --- drivers/char/random.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index d20ba1b104ca..0580968fd28c 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -660,7 +660,7 @@ static void process_random_ready_list(void) */ static void credit_entropy_bits(struct entropy_store *r, int nbits) { - int entropy_count, orig, has_initialized = 0; + int entropy_count, orig; const int pool_size = r->poolinfo->poolfracbits; int nfrac = nbits << ENTROPY_SHIFT; @@ -717,11 +717,6 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits) if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) goto retry; - if (has_initialized) { - r->initialized = 1; - kill_fasync(&fasync, SIGIO, POLL_IN); - } - trace_credit_entropy_bits(r->name, nbits, entropy_count >> ENTROPY_SHIFT, _RET_IP_); -- 2.26.2