From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <test-report-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D282F46436
	for <public@inbox.dpdk.org>; Fri, 21 Mar 2025 08:53:20 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id CBC764066F;
	Fri, 21 Mar 2025 08:53:20 +0100 (CET)
Received: from dpdk.org (dpdk.org [92.243.24.197])
 by mails.dpdk.org (Postfix) with ESMTP id 04C0340276
 for <test-report@dpdk.org>; Fri, 21 Mar 2025 08:53:19 +0100 (CET)
Received: by dpdk.org (Postfix, from userid 65534)
 id 8C4BB127183; Fri, 21 Mar 2025 08:53:03 +0100 (CET)
Subject: |WARNING| pw152514 [PATCH v6 14/14] net/zxdh: optimize msg processing
 ops and modify some issues
In-Reply-To: <20250321073200.2015711-15-chen.bingbin@zte.com.cn>
References: <20250321073200.2015711-15-chen.bingbin@zte.com.cn>
To: test-report@dpdk.org
From: checkpatch@dpdk.org
Cc: Bingbin Chen <chen.bingbin@zte.com.cn>
Message-Id: <20250321075303.8C4BB127183@dpdk.org>
Date: Fri, 21 Mar 2025 08:53:03 +0100 (CET)
X-BeenThere: test-report@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: automatic DPDK test reports <test-report.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/test-report>,
 <mailto:test-report-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/test-report/>
List-Post: <mailto:test-report@dpdk.org>
List-Help: <mailto:test-report-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/test-report>,
 <mailto:test-report-request@dpdk.org?subject=subscribe>
Errors-To: test-report-bounces@dpdk.org

Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/152514

_coding style issues_


CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'fld' may be better as '(fld)' to avoid precedence issues
#146: FILE: drivers/net/zxdh/zxdh_common.h:69:
+#define __zxdh_bit_sz(typ, fld) sizeof(__zxdh_nullp(typ)->fld)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'fld' may be better as '(fld)' to avoid precedence issues
#147: FILE: drivers/net/zxdh/zxdh_common.h:70:
+#define __zxdh_bit_off(typ, fld) ((unsigned int)(uintptr_t) \
+				  (&(__zxdh_nullp(typ)->fld)))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#149: FILE: drivers/net/zxdh/zxdh_common.h:72:
+#define __zxdh_dw_bit_off(typ, fld) (32 - __zxdh_bit_sz(typ, fld) - \
+				    (__zxdh_bit_off(typ, fld) & 0x1f))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#149: FILE: drivers/net/zxdh/zxdh_common.h:72:
+#define __zxdh_dw_bit_off(typ, fld) (32 - __zxdh_bit_sz(typ, fld) - \
+				    (__zxdh_bit_off(typ, fld) & 0x1f))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#153: FILE: drivers/net/zxdh/zxdh_common.h:76:
+#define __zxdh_dw_mask(typ, fld) (__zxdh_mask(typ, fld) << \
+				  __zxdh_dw_bit_off(typ, fld))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#153: FILE: drivers/net/zxdh/zxdh_common.h:76:
+#define __zxdh_dw_mask(typ, fld) (__zxdh_mask(typ, fld) << \
+				  __zxdh_dw_bit_off(typ, fld))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#157: FILE: drivers/net/zxdh/zxdh_common.h:80:
+#define __zxdh_16_bit_off(typ, fld) (16 - __zxdh_bit_sz(typ, fld) - \
+				    (__zxdh_bit_off(typ, fld) & 0xf))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#157: FILE: drivers/net/zxdh/zxdh_common.h:80:
+#define __zxdh_16_bit_off(typ, fld) (16 - __zxdh_bit_sz(typ, fld) - \
+				    (__zxdh_bit_off(typ, fld) & 0xf))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#160: FILE: drivers/net/zxdh/zxdh_common.h:83:
+#define __zxdh_16_mask(typ, fld) (__zxdh_mask16(typ, fld) << \
+				  __zxdh_16_bit_off(typ, fld))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#160: FILE: drivers/net/zxdh/zxdh_common.h:83:
+#define __zxdh_16_mask(typ, fld) (__zxdh_mask16(typ, fld) << \
+				  __zxdh_16_bit_off(typ, fld))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#172: FILE: drivers/net/zxdh/zxdh_common.h:95:
+#define ZXDH_SET(typ, p, fld, v) do { \
+	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
+	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
+	zxdh_set_value(fld_sz, addr, v); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#172: FILE: drivers/net/zxdh/zxdh_common.h:95:
+#define ZXDH_SET(typ, p, fld, v) do { \
+	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
+	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
+	zxdh_set_value(fld_sz, addr, v); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'typ' - possible side-effects?
#179: FILE: drivers/net/zxdh/zxdh_common.h:102:
+#define ZXDH_GET(typ, p, fld) ({ \
+	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
+	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
+	zxdh_get_value(fld_sz, addr); \
+})

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fld' - possible side-effects?
#179: FILE: drivers/net/zxdh/zxdh_common.h:102:
+#define ZXDH_GET(typ, p, fld) ({ \
+	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
+	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
+	zxdh_get_value(fld_sz, addr); \
+})

total: 0 errors, 0 warnings, 14 checks, 2089 lines checked
Warning in drivers/net/zxdh/zxdh_common.h:
Using __builtin helpers, prefer EAL macros