From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7DCB45BAC; Wed, 23 Oct 2024 09:23:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 334474065D; Wed, 23 Oct 2024 09:23:23 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 41E51402E4 for ; Wed, 23 Oct 2024 09:23:22 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4XYL8F0sy7zyTd6; Wed, 23 Oct 2024 15:21:49 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 755581400D8; Wed, 23 Oct 2024 15:23:20 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 23 Oct 2024 15:23:19 +0800 From: Jie Hai To: , , CC: , , , Subject: [PATCH] net/hns3: fix inaccurate error log Date: Wed, 23 Oct 2024 15:12:35 +0800 Message-ID: <20241023071235.29672-1-haijie1@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemf500004.china.huawei.com (7.202.181.242) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If register number obtained from firmware is different from the register list driver hold, an error log occurs. The incorrect use of `&&` makes this log inaccurate, change it to `&`. Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index fef904a296c0..8a6ddbfe8ccd 100644 --- a/drivers/net/hns3/hns3_regs.c +++ b/drivers/net/hns3/hns3_regs.c @@ -897,7 +897,7 @@ hns3_get_name_by_module(enum hns3_reg_modules module) size_t i; for (i = 0; i < RTE_DIM(hns3_module_name_map); i++) { - if (hns3_module_name_map[i].module && HNS3_MODULE_MASK(module) != 0) + if ((hns3_module_name_map[i].module & HNS3_MODULE_MASK(module)) != 0) return hns3_module_name_map[i].name; } return "unknown"; -- 2.22.0