Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7140726rwb; Wed, 23 Nov 2022 02:45:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf45izwQSlXmHRvM0uzlQ2a3S5XhL9HwGHqivMT07QMImxZ3uAm38kfDxIm249870tOVgFEm X-Received: by 2002:a05:6402:1a28:b0:469:7546:60fe with SMTP id be8-20020a0564021a2800b00469754660femr10637814edb.408.1669200358175; Wed, 23 Nov 2022 02:45:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669200358; cv=none; d=google.com; s=arc-20160816; b=ytFnXNtCNGWoy8G0clKyYswSldVPqwBO8KVTki8yVKvBKIpATX8dsB279s9ENeNc+M alRmhiLflFkn16tVb86124R57xQC2OmdsuQS/dgjWrfvSxTay718H/ymQcTZI9jcBYfD fCjhacPdoMHMkgH4iONE7j1CGLZlSpzWOD7XZgc0tycKFfoc7EUk2R+elZ2T3w7ZDIx6 XSMJN46KRwWYhfsok3EW1sn8TY9849wBczmd81ndmN3h1btd1S/V7G81Wlbeyb8GpM42 +Ga/i853SVAf1/VyWMk3/psGGu59CDcNTffTTGXjNWJIy/CORJNoGQX0raxe4xpmE7eD NfUw== 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 :message-id:date:subject:cc:to:from; bh=xKsXGRyyTj57L9VRzdGb8T6KefWbl540oIZlqHpLffg=; b=AVuZN5RzfG2eW5BIxMbCg881eXOqzzoOnujNIbfS4BXpiqr85Q7FuRsrQv+U31fhM/ LRnnRWH7V17pODcHGJzuwkVDGSYV0iIxMpwAU9hDzIOh2dMOvBL6qaH6WLzdEHnmOAHL ouwC1PNIKqDnEyUw94E/luvv+tM9n9QOZoUIShk2TCUA/txvFYPoyGFqLzL9Kl1HzfsR SUrYB+247GnFFrVrB8seiDB383Gl/R9rMmMLdSShi/mG6t0QgGTxB1RVIFfoem9soZru xZ5EGACoEd51qeKZM9vTB0HgEJNhapsmQbaMg8KsbYX2tXia6cNldV+rEXLIE2Y471B3 V7zQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d42-20020a056402402a00b0045cf3759408si13062463eda.49.2022.11.23.02.45.36; Wed, 23 Nov 2022 02:45:58 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237955AbiKWJj6 (ORCPT + 88 others); Wed, 23 Nov 2022 04:39:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237934AbiKWJjj (ORCPT ); Wed, 23 Nov 2022 04:39:39 -0500 Received: from out199-3.us.a.mail.aliyun.com (out199-3.us.a.mail.aliyun.com [47.90.199.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D45810613D; Wed, 23 Nov 2022 01:37:20 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R511e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VVWMaJV_1669196233; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VVWMaJV_1669196233) by smtp.aliyun-inc.com; Wed, 23 Nov 2022 17:37:17 +0800 From: Jiapeng Chong To: tgraf@suug.ch Cc: herbert@gondor.apana.org.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries' Date: Wed, 23 Nov 2022 17:37:02 +0800 Message-Id: <20221123093702.32219-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 Variable 'insert_retries' is not effectively used in the function, so delete it. lib/test_rhashtable.c:437:18: warning: variable 'insert_retries' set but not used. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3242 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: -The condition for modifying err is less than 0. lib/test_rhashtable.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index 6a8e445c8b55..c20f6cb4bf55 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c @@ -434,7 +434,7 @@ static int __init test_rhltable(unsigned int entries) static int __init test_rhashtable_max(struct test_obj *array, unsigned int entries) { - unsigned int i, insert_retries = 0; + unsigned int i; int err; test_rht_params.max_size = roundup_pow_of_two(entries / 8); @@ -447,9 +447,7 @@ static int __init test_rhashtable_max(struct test_obj *array, obj->value.id = i * 2; err = insert_retry(&ht, obj, test_rht_params); - if (err > 0) - insert_retries += err; - else if (err) + if (err < 0) return err; } -- 2.20.1.7.g153144c