automatic DPDK test reports
 help / color / mirror / Atom feed
From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Bingbin Chen <chen.bingbin@zte.com.cn>
Subject: |WARNING| pw152475 [PATCH v5 14/14] net/zxdh: fix debugging errors
Date: Wed, 19 Mar 2025 10:19:05 +0100 (CET)	[thread overview]
Message-ID: <20250319091905.1692F1234FB@dpdk.org> (raw)
In-Reply-To: <20250319085808.1912523-15-chen.bingbin@zte.com.cn>

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

_coding style issues_


CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'fld' may be better as '(fld)' to avoid precedence issues
#137: FILE: drivers/net/zxdh/zxdh_common.h:68:
+#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
#138: FILE: drivers/net/zxdh/zxdh_common.h:69:
+#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?
#140: FILE: drivers/net/zxdh/zxdh_common.h:71:
+#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?
#140: FILE: drivers/net/zxdh/zxdh_common.h:71:
+#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?
#144: FILE: drivers/net/zxdh/zxdh_common.h:75:
+#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?
#144: FILE: drivers/net/zxdh/zxdh_common.h:75:
+#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?
#148: FILE: drivers/net/zxdh/zxdh_common.h:79:
+#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?
#148: FILE: drivers/net/zxdh/zxdh_common.h:79:
+#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?
#151: FILE: drivers/net/zxdh/zxdh_common.h:82:
+#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?
#151: FILE: drivers/net/zxdh/zxdh_common.h:82:
+#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?
#163: FILE: drivers/net/zxdh/zxdh_common.h:94:
+#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?
#163: FILE: drivers/net/zxdh/zxdh_common.h:94:
+#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?
#170: FILE: drivers/net/zxdh/zxdh_common.h:101:
+#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?
#170: FILE: drivers/net/zxdh/zxdh_common.h:101:
+#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, 2268 lines checked
Warning in drivers/net/zxdh/zxdh_common.h:
Writing to stdout or stderr
Warning in drivers/net/zxdh/zxdh_common.h:
Using __builtin helpers, prefer EAL macros

  parent reply	other threads:[~2025-03-19  9:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250319085808.1912523-15-chen.bingbin@zte.com.cn>
2025-03-19  8:54 ` |SUCCESS| pw152462-152475 " qemudev
2025-03-19  8:59 ` |FAILURE| " qemudev
2025-03-19  9:19 ` checkpatch [this message]
2025-03-19 10:04 ` |SUCCESS| pw152475 " 0-day Robot
2025-03-19 18:45 ` |SUCCESS| pw152462-152475 [PATCH] [v5,14/14] net/zxdh: fix debugging dpdklab
2025-03-19 18:46 ` dpdklab
2025-03-19 18:50 ` |PENDING| " dpdklab
2025-03-19 18:55 ` |SUCCESS| " dpdklab
2025-03-19 18:58 ` dpdklab
2025-03-19 18:59 ` |PENDING| " dpdklab
2025-03-19 18:59 ` |SUCCESS| " dpdklab
2025-03-19 19:02 ` dpdklab
2025-03-19 19:08 ` dpdklab
2025-03-19 19:14 ` dpdklab
2025-03-19 19:15 ` |PENDING| " dpdklab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319091905.1692F1234FB@dpdk.org \
    --to=checkpatch@dpdk.org \
    --cc=chen.bingbin@zte.com.cn \
    --cc=test-report@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).