Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7024820rwb; Wed, 23 Nov 2022 00:41:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Zo8Pu9DutCmkgaX9I53J7tS9NDSXXX6Ojoa0iNigWaQeMC6cxakOCWKXTAITDc7BI9Qrn X-Received: by 2002:a17:907:1df2:b0:7ae:8411:112c with SMTP id og50-20020a1709071df200b007ae8411112cmr21895136ejc.97.1669192874942; Wed, 23 Nov 2022 00:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669192874; cv=none; d=google.com; s=arc-20160816; b=Hr+CeqcuPfJjgib4Ql1FhPLJrg2mrn5VudAo8dbVVDM9IW2cw3tSMWER0n5UJ0ZaY3 6SR5aiQ4ruOr/9zGAXoUZYNtR6A67iXWskssh60RyBs0E45pC6iSWVz2jP7BvjdthdAZ ngNjeGyIQw3EHGKDo1vBqwN6lQUgFpivRMQ0A4sdXFq0PboGow+Et+2bC+c/ElYl4eQ9 N7OThuEhGmX/V5L1JRkAqCWWT6sXaKHHkXVDDs4BUGc+/hEHOxxV1KBRCA/H06YJ2I+G fUtZ3YXPB8E9sA4zCU0K9h9dy66N2oCP1CmS9zzXg7Bt9e4dPxndHTiCjS5jEmLkT0l5 orxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=w8B6MjpffUj9lQ+4Hf6Po1QRcm2YX7OVcqHSmMnK5Gk=; b=npmpwtgucQF+QiovlHhWNobfGpWExErC5HfKEvzj3zFfq/chYQ50kQGgFbDWE4tOem JsVzefJDMlXT43j+l5yXI+KW9uG57oSzolVjuni8tU2gYnJXZwo8j6pNhzdR6y6pvcen nQuTkUkNPQpSrHz9Xe6bk/jxd1tXm6K+P3sIR1RZHYZorWukC5tXcCi2pFy+pvG/Ox8Y 4lDECi0dFqQVhNdUSwBOkRa3n1GswQhrER6ia/HM0iVeQUXFu+MXLezLVrrNvP6UudXn ZaaNbo7G+cm0VYD1vxSFtv18BtQX+8/hnKMaUf8oGxPwcM5AbhZY6sKqSqskMk6Y//Wn FUGw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a170906234a00b0078d4962a32asi10521233eja.961.2022.11.23.00.40.50; Wed, 23 Nov 2022 00:41:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236458AbiKWIUb (ORCPT + 89 others); Wed, 23 Nov 2022 03:20:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236346AbiKWIUY (ORCPT ); Wed, 23 Nov 2022 03:20:24 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DFD6F1DA6; Wed, 23 Nov 2022 00:20:19 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oxkzQ-00HThe-3M; Wed, 23 Nov 2022 16:20:17 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Wed, 23 Nov 2022 16:20:16 +0800 Date: Wed, 23 Nov 2022 16:20:16 +0800 From: Herbert Xu To: Jiapeng Chong Cc: tgraf@suug.ch, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH] lib/test_rhashtable: Remove set but unused variable 'insert_retries' Message-ID: References: <20221123035951.10720-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221123035951.10720-1-jiapeng.chong@linux.alibaba.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 On Wed, Nov 23, 2022 at 11:59:51AM +0800, Jiapeng Chong wrote: > > @@ -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) This is wrong as you will now abort on a retried insertion. You should instead test for err < 0. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt