Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1986123ybt; Sun, 28 Jun 2020 04:27:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8SV3SHi9BsQZLiot05SzmY+RQ4STjCooZW6Gk6UYiKKjg/oncuM5Ia+Gff6ALjt48MlJY X-Received: by 2002:a50:d8c2:: with SMTP id y2mr4604309edj.114.1593343629006; Sun, 28 Jun 2020 04:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593343628; cv=none; d=google.com; s=arc-20160816; b=GQfPG5ezfYYvLqdWWS1lQvPDIE7XSIgyIymE1a25hgDeLTmfqCfZ4l8oPGiTJBvL6+ ZJC2aZ6J5xSLFo94wR36DRdL98W9SpKFvrqLGsVvZcGlg19CLEEiYzfZjCFZH3uCVrSU NMqNOwp6/OMbiwXjs2C1ajnXzUxH0mDaiCSyT89euiEMnKWuCJ3nc115W8JeRR8RsRAc urjWKaDh8VkumVT8I6zfpLSSc+movZ5c3bNnaKc/jUMoxqoc1lrbotTOA3eqeDi0jKyd Qcqrn5J2kfe06caYA0A39a3S1+Og3iLblXCkS+fTs0LwYvWmn9NMB9xJ7iz/M2jK4e4u 72eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=tdXi5ZALGq723jeCMJyTPGDBlRJVtOc9uxXIl4UeyZA=; b=ML4UGi9RW6gNydva53Q6uCQ/djdmACsRztopgdnTHZuvDyv2fKIalkILjwYCkneido brXNAVweEsUCO1iWzmZ4Cwz9/c+BGZS6keEzAt7liUe3DpXwFII9SEo99lb8v9SSOT0C USidrFXfZ34EccLgSIjUdced1KtFO/rboSJmg12o0AgjCJa19eYoZ5jZzdA2IV0k65mx 8VRh2KMyuGBko2xL3ETUAy5scGWW9d2SaoLyMJCpKFUAYvz0PFRsDsIB+iO2Fjro2PFQ pdNdnkkO8t1SeBJM462/3wL45TUQu9rQzMhJ9RQ3tPY/XAy//gu3GFIWP4bLVU8kKgm+ 6cRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 v20si8490836ejj.365.2020.06.28.04.26.46; Sun, 28 Jun 2020 04:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbgF1LXU (ORCPT + 99 others); Sun, 28 Jun 2020 07:23:20 -0400 Received: from mx139-tc.baidu.com ([61.135.168.139]:51103 "EHLO tc-sys-mailedm01.tc.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbgF1LXU (ORCPT ); Sun, 28 Jun 2020 07:23:20 -0400 Received: from localhost (cp01-cos-dev01.cp01.baidu.com [10.92.119.46]) by tc-sys-mailedm01.tc.baidu.com (Postfix) with ESMTP id 0772F2040055; Sun, 28 Jun 2020 19:23:05 +0800 (CST) From: Li RongQing To: tytso@mit.edu, arnd@arndb.de, linux-kernel@vger.kernel.org Subject: [PATCH] random: get rid of dead codes from credit_entropy_bits Date: Sun, 28 Jun 2020 19:23:04 +0800 Message-Id: <1593343384-1292-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 90ea1c6436d2 ("random: remove the blocking pool"), has_initialized is zero always, and initialized of struct entropy_store is not used Signed-off-by: Li RongQing --- drivers/char/random.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index a7cf6aa65908..288cc4464a69 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -500,7 +500,6 @@ struct entropy_store { unsigned short add_ptr; unsigned short input_rotate; int entropy_count; - unsigned int initialized:1; unsigned int last_data_init:1; __u8 last_data[EXTRACT_SIZE]; }; @@ -660,7 +659,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 +716,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.16.2