From patchwork Fri Nov 25 12:23:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 25968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3977959wrr; Fri, 25 Nov 2022 04:29:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7nulvqTXLwe0LSrNI3dL+1Wj4JFsJCLxGURpO8h37oaPUimyZ3VJ20z8y2qMp6zZShkAUQ X-Received: by 2002:a62:1ad6:0:b0:574:b2f1:2fbc with SMTP id a205-20020a621ad6000000b00574b2f12fbcmr3554463pfa.26.1669379396333; Fri, 25 Nov 2022 04:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669379396; cv=none; d=google.com; s=arc-20160816; b=zRmQ/WIjzD0pLgia64nU4BNf48w4ZXepfqXTLZ5QDmaj/B2amC0XAZ5rqDw1/5nA/o RSI/qPpo6E3hTPRofIctMtHH+VOl+L6jeG2PN0e3apHw0nvjmL82c5FmBD71sGZw6z7e QTqpGQT6RFA6k6GIIla5AkrOMuZps/jlugqUpdXN5yZpfsjHtcRK68f8i0npOe70DTQH 93GJV34ZZTFgQwoarpr+Yr1OK17ADkTVdDEZoDZBXASywNl9b1xUWndB+DP5fnThPs+v nSQuM3CM9rtMzCRy57WtbMymXk10m1UYtIB3OLRYs6Iwa4sRIL2XAQT6sjGlbActAxRp toew== 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=Gko7Lae01/IvX1CBHbX5sjbvJwG3PeZJfkdkqz8yjl0=; b=O7BwnDeoIhym/nmxd/ptA6ohcRTe+l/6FONpQCVyMAqsvSPtV4e3NCeKrquoUydscl r1ic8cKzvMCE+wVujkxIDEaJ17HpJ2lSE0VkJv96zlMdfaOK2UyCfHnPoNrLClD73mCM SbebJqAFF7JOWKhpt65H5U1T1jonQihrGWGtGol93RD4Gk/wAFMUu8lGiS/4pbH9bE7A Vw0IS7aQFC+GdjKRV7q2Hgq1yLt6w49mekzulGFhqVdj3UtT+aSs9SlLOjsXDG7COATk lCtduC6am2m7a7DfK6U/vZWB3GyPHsFCwXlumwBk7JeY3/Vfs6QHqhI4g+l2a99U1t1W WIpQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b00176808b0a3asi2865831plr.441.2022.11.25.04.29.42; Fri, 25 Nov 2022 04:29:56 -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 S229832AbiKYMYJ (ORCPT + 99 others); Fri, 25 Nov 2022 07:24:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiKYMYH (ORCPT ); Fri, 25 Nov 2022 07:24:07 -0500 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2617F30F74 for ; Fri, 25 Nov 2022 04:24:07 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id yXkRoPBKkY4XVyXkRoE1zY; Fri, 25 Nov 2022 13:24:05 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 25 Nov 2022 13:24:05 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH 1/5] octeontx2-af: Fix a potentially spurious error message Date: Fri, 25 Nov 2022 13:23:57 +0100 Message-Id: <5ce01c402f86412dc57884ff0994b63f0c5b3871.1669378798.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750471169848090044?= X-GMAIL-MSGID: =?utf-8?q?1750471169848090044?= When this error message is displayed, we know that the all the bits in the bitmap are set. So, bitmap_weight() will return the number of bits of the bitmap, which is 'table->tot_ids'. It is unlikely that a bit will be cleared between mutex_unlock() and dev_err(), but, in order to simplify the code and avoid this possibility, just take 'table->tot_ids'. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 594029007f85..5e6c54577a97 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -490,7 +490,7 @@ static bool rvu_npc_exact_alloc_id(struct rvu *rvu, u32 *seq_id) if (idx == table->tot_ids) { mutex_unlock(&table->lock); dev_err(rvu->dev, "%s: No space in id bitmap (%d)\n", - __func__, bitmap_weight(table->id_bmap, table->tot_ids)); + __func__, table->tot_ids); return false; }