automatic DPDK test reports
 help / color / mirror / Atom feed
* [dpdk-test-report] |WARNING| pw69974 [PATCH v2 1/2] net/ixgbe: fix defects of macro in VF
       [not found] <20200508044618.70535-2-guinanx.sun@intel.com>
@ 2020-05-08  5:00 ` checkpatch
  0 siblings, 0 replies; only message in thread
From: checkpatch @ 2020-05-08  5:00 UTC (permalink / raw)
  To: test-report; +Cc: Guinan Sun

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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects?
#111: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:405:
+#define UPDATE_VF_STAT_36BIT(lsb, msb, last, cur)               \
+{                                                               \
+	u64 new_lsb = IXGBE_READ_REG(hw, lsb);                  \
+	u64 new_msb = IXGBE_READ_REG(hw, msb);                  \
+	u64 latest = ((new_msb << 32) | new_lsb);               \
+	u64 stat = 0;                                           \
+	if (latest >= last)                                     \
+		stat = latest - last;                           \
+	else                                                    \
+		stat = (u64)((latest +                          \
+			((u64)1 << IXGBE_36_BIT_WIDTH)) - last);\
+	cur += stat & IXGBE_36_BIT_MASK;                        \
+	last = latest;                                          \
 }

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'last' may be better as '(last)' to avoid precedence issues
#111: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:405:
+#define UPDATE_VF_STAT_36BIT(lsb, msb, last, cur)               \
+{                                                               \
+	u64 new_lsb = IXGBE_READ_REG(hw, lsb);                  \
+	u64 new_msb = IXGBE_READ_REG(hw, msb);                  \
+	u64 latest = ((new_msb << 32) | new_lsb);               \
+	u64 stat = 0;                                           \
+	if (latest >= last)                                     \
+		stat = latest - last;                           \
+	else                                                    \
+		stat = (u64)((latest +                          \
+			((u64)1 << IXGBE_36_BIT_WIDTH)) - last);\
+	cur += stat & IXGBE_36_BIT_MASK;                        \
+	last = latest;                                          \
 }

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues
#111: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:405:
+#define UPDATE_VF_STAT_36BIT(lsb, msb, last, cur)               \
+{                                                               \
+	u64 new_lsb = IXGBE_READ_REG(hw, lsb);                  \
+	u64 new_msb = IXGBE_READ_REG(hw, msb);                  \
+	u64 latest = ((new_msb << 32) | new_lsb);               \
+	u64 stat = 0;                                           \
+	if (latest >= last)                                     \
+		stat = latest - last;                           \
+	else                                                    \
+		stat = (u64)((latest +                          \
+			((u64)1 << IXGBE_36_BIT_WIDTH)) - last);\
+	cur += stat & IXGBE_36_BIT_MASK;                        \
+	last = latest;                                          \
 }

total: 0 errors, 0 warnings, 3 checks, 47 lines checked

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-08  5:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200508044618.70535-2-guinanx.sun@intel.com>
2020-05-08  5:00 ` [dpdk-test-report] |WARNING| pw69974 [PATCH v2 1/2] net/ixgbe: fix defects of macro in VF checkpatch

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).