From patchwork Fri Nov 25 12:24:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 25972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3978881wrr; Fri, 25 Nov 2022 04:31:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BBHlED1i/a1Ut4WaQVkF5h4Up0SloM7iWOi3ffv6nv1EkVCJEiyvKMTmZaSfNa2c8mNoJ X-Received: by 2002:a17:907:9190:b0:78a:52bb:d904 with SMTP id bp16-20020a170907919000b0078a52bbd904mr15334883ejb.630.1669379474112; Fri, 25 Nov 2022 04:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669379474; cv=none; d=google.com; s=arc-20160816; b=cgcNdY+j8sR3ThTdi4K/WiRATMyEKFEKkXl8PsdtAeIlNcZ2ewoYEMcOPY8yEG65Qa XNPMyBxtdboYRM7Q2dUQ8B2xmEYaMQbAHMgdWAkTeXZRwFMmBR2n6KqltF/69LQkkfX2 eGW3eZeXlc+kAkk89JKp9eiaxGcWlelCHxKtAUimCu2zFAKE3nPYkJE4o5l8QKzCcTrD V+KZHecrL25p+aj2c53PhZt6hFMrBeWLbPU1iI0gZueFaWCFLQ+R8reXSOTlkCrxdmRB sGtBm4DZzFWUWYhKH9mO0FnoA5zxnHA2RuzYihD6b4VZCDkUbrbvaulexlOFqA4d7nnf VXuw== 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=mWofOACcUsQqmpXGZXWbhxEeO0Y5wvu0jfpPx+iEMDw=; b=nRlWWwVjeT5KDAnk7rRZc0CZoJUbLCeNK90vodZaKzZK98hsNT/TIRwsGiVki7JxyK aCWbfmN4PQ1q5k8H3m05GRG6aPgyrSuegyzjq8DV77v2JgmDlymro02MNVy3BmLw7r/l eSz3J0vyW9MpaKhfQOfCv/7oB5/jmhj/A/3NoukLFk8LxQ4Z40CMnqNK+vpXyF4i2LKu /ScrZL7XlNy18HHbLRWNQ2fkfOGzjJTtJtcnAAsEn0f5cZ6JhwcSyXSaPSS0LrSjCo2Z YW0Ax/OMuhlQ4HwlbBeeKyzc3+KR7WFsVUxuVX4MjmN05Blk+8OFuiI4Bd1MRNfEkhAm 0nRA== 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 hr11-20020a1709073f8b00b007ad8140c60asi3656836ejc.492.2022.11.25.04.30.49; Fri, 25 Nov 2022 04:31: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 S229926AbiKYMYd (ORCPT + 99 others); Fri, 25 Nov 2022 07:24:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbiKYMYT (ORCPT ); Fri, 25 Nov 2022 07:24:19 -0500 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E004A9C2 for ; Fri, 25 Nov 2022 04:24:14 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id yXkRoPBKkY4XVyXkaoE21L; Fri, 25 Nov 2022 13:24:13 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 25 Nov 2022 13:24:13 +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 5/5] octeontx2-af: Simplify a size computation in rvu_npc_exact_init() Date: Fri, 25 Nov 2022 13:24:01 +0100 Message-Id: <5230dabe27f48948a9fd0f50a62e2437b65e6a6e.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=unavailable 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?1750471251582887402?= X-GMAIL-MSGID: =?utf-8?q?1750471251582887402?= We know that table_size = table->mem_table.depth * table->mem_table.ways, so use it instead, it is less verbose. 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 ae34746341c4..00aef8f5ac29 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -1913,7 +1913,7 @@ int rvu_npc_exact_init(struct rvu *rvu) dev_dbg(rvu->dev, "%s: Allocated bitmap for 32 entry cam\n", __func__); - table->tot_ids = (table->mem_table.depth * table->mem_table.ways) + table->cam_table.depth; + table->tot_ids = table_size + table->cam_table.depth; table->id_bmap = devm_bitmap_zalloc(rvu->dev, table->tot_ids, GFP_KERNEL);