From 6f09fb9ce1bccd21cfa39f0a927f05d4c0a87b70 Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Wed, 23 Oct 2024 15:12:35 +0800
Subject: [PATCH] net/hns3: fix error log

[ upstream commit f58fd22240c27ea20cf41dd2aa15810712f518bf ]

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 `&`.

Fixes: 99d3bd8b85d3 ("net/hns3: support filtering registers by module names")

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 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 8148a63..def775a 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.33.0

