automatic DPDK test reports
 help / color / mirror / Atom feed
From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [dpdk-test-report] |WARNING| pw89545 [PATCH v2 6/6] net/ngbe: define registers
Date: Fri, 19 Mar 2021 08:28:35 +0100 (CET)	[thread overview]
Message-ID: <20210319072835.64F30A54E@dpdk.org> (raw)
In-Reply-To: <20210319072628.10000-7-jiawenwu@trustnetic.com>

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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'y' - possible side-effects?
#107: FILE: drivers/net/ngbe/base/ngbe_regs.h:35:
+#define ROUND_UP(x, y)          (((x) + (y) - 1) / (y) * (y))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'y' - possible side-effects?
#108: FILE: drivers/net/ngbe/base/ngbe_regs.h:36:
+#define ROUND_DOWN(x, y)        ((x) / (y) * (y))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#109: FILE: drivers/net/ngbe/base/ngbe_regs.h:37:
+#define ROUND_OVER(x, maxbits, unitbits) \
+	((x) >= 1 << (maxbits) ? 0 : (x) >> (unitbits))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tc' - possible side-effects?
#840: FILE: drivers/net/ngbe/base/ngbe_regs.h:768:
+#define   NGBE_PBTXSTAT_EMPT(tc, r)	((1 << (tc) & (r)) >> (tc))

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects?
#1355: FILE: drivers/net/ngbe/base/ngbe_regs.h:1283:
+#define NGBE_UPDCNT32(reg, last, cur)                           \
+do {                                                             \
+	uint32_t latest = rd32(hw, reg);                         \
+	if (hw->offset_loaded || hw->rx_loaded)			 \
+		last = 0;					 \
+	cur += (latest - last) & UINT_MAX;                       \
+	last = latest;                                           \
+} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues
#1355: FILE: drivers/net/ngbe/base/ngbe_regs.h:1283:
+#define NGBE_UPDCNT32(reg, last, cur)                           \
+do {                                                             \
+	uint32_t latest = rd32(hw, reg);                         \
+	if (hw->offset_loaded || hw->rx_loaded)			 \
+		last = 0;					 \
+	cur += (latest - last) & UINT_MAX;                       \
+	last = latest;                                           \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'regl' - possible side-effects?
#1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292:
+#define NGBE_UPDCNT36(regl, last, cur)                          \
+do {                                                             \
+	uint64_t new_lsb = rd32(hw, regl);                       \
+	uint64_t new_msb = rd32(hw, regl + 4);                   \
+	uint64_t latest = ((new_msb << 32) | new_lsb);           \
+	if (hw->offset_loaded || hw->rx_loaded)			 \
+		last = 0;					 \
+	cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \
+	last = latest;                                           \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects?
#1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292:
+#define NGBE_UPDCNT36(regl, last, cur)                          \
+do {                                                             \
+	uint64_t new_lsb = rd32(hw, regl);                       \
+	uint64_t new_msb = rd32(hw, regl + 4);                   \
+	uint64_t latest = ((new_msb << 32) | new_lsb);           \
+	if (hw->offset_loaded || hw->rx_loaded)			 \
+		last = 0;					 \
+	cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \
+	last = latest;                                           \
+} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues
#1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292:
+#define NGBE_UPDCNT36(regl, last, cur)                          \
+do {                                                             \
+	uint64_t new_lsb = rd32(hw, regl);                       \
+	uint64_t new_msb = rd32(hw, regl + 4);                   \
+	uint64_t latest = ((new_msb << 32) | new_lsb);           \
+	if (hw->offset_loaded || hw->rx_loaded)			 \
+		last = 0;					 \
+	cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \
+	last = latest;                                           \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hw' - possible side-effects?
#1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443:
+#define rd32w(hw, reg, mask, slice) do { \
+	rd32((hw), reg); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'reg' - possible side-effects?
#1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443:
+#define rd32w(hw, reg, mask, slice) do { \
+	rd32((hw), reg); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'mask' - possible side-effects?
#1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443:
+#define rd32w(hw, reg, mask, slice) do { \
+	rd32((hw), reg); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hw' - possible side-effects?
#1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448:
+#define wr32w(hw, reg, val, mask, slice) do { \
+	wr32((hw), reg, val); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'reg' - possible side-effects?
#1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448:
+#define wr32w(hw, reg, val, mask, slice) do { \
+	wr32((hw), reg, val); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'mask' - possible side-effects?
#1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448:
+#define wr32w(hw, reg, val, mask, slice) do { \
+	wr32((hw), reg, val); \
+	po32m((hw), reg, mask, mask, NULL, 5, slice); \
+} while (0)

total: 0 errors, 0 warnings, 15 checks, 1495 lines checked

       reply	other threads:[~2021-03-19  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210319072628.10000-7-jiawenwu@trustnetic.com>
2021-03-19  7:28 ` checkpatch [this message]
2021-03-19  8:55 ` [dpdk-test-report] |SUCCESS| pw89545 " 0-day Robot
2021-03-19  8:57 ` [dpdk-test-report] |SUCCESS| pw89545 [dpdk-dev] [PATCH v2 6/6] " 0-day Robot

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=20210319072835.64F30A54E@dpdk.org \
    --to=checkpatch@dpdk.org \
    --cc=jiawenwu@trustnetic.com \
    --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).