[dpdk-test-report] |WARNING| pw63734 [PATCH] net/e1000: update UPDATE_VF_STAT to handle rollover

checkpatch at dpdk.org checkpatch at dpdk.org
Wed Dec 11 03:49:36 CET 2019


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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects?
#83: FILE: drivers/net/e1000/igb_ethdev.c:264:
+#define UPDATE_VF_STAT(reg, last, cur)                          \
+{                                                               \
+	u32 latest = E1000_READ_REG(hw, reg);                   \
+	if (latest >= last)                                     \
+		cur += (latest - last);                         \
+	else                                                    \
+		cur += ((latest + ((uint64_t)1 << 32)) - last); \
+	cur &= UINT_MAX;                                        \
+	last = latest;                                          \
 }

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'last' may be better as '(last)' to avoid precedence issues
#83: FILE: drivers/net/e1000/igb_ethdev.c:264:
+#define UPDATE_VF_STAT(reg, last, cur)                          \
+{                                                               \
+	u32 latest = E1000_READ_REG(hw, reg);                   \
+	if (latest >= last)                                     \
+		cur += (latest - last);                         \
+	else                                                    \
+		cur += ((latest + ((uint64_t)1 << 32)) - last); \
+	cur &= UINT_MAX;                                        \
+	last = latest;                                          \
 }

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'cur' - possible side-effects?
#83: FILE: drivers/net/e1000/igb_ethdev.c:264:
+#define UPDATE_VF_STAT(reg, last, cur)                          \
+{                                                               \
+	u32 latest = E1000_READ_REG(hw, reg);                   \
+	if (latest >= last)                                     \
+		cur += (latest - last);                         \
+	else                                                    \
+		cur += ((latest + ((uint64_t)1 << 32)) - last); \
+	cur &= UINT_MAX;                                        \
+	last = latest;                                          \
 }

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues
#83: FILE: drivers/net/e1000/igb_ethdev.c:264:
+#define UPDATE_VF_STAT(reg, last, cur)                          \
+{                                                               \
+	u32 latest = E1000_READ_REG(hw, reg);                   \
+	if (latest >= last)                                     \
+		cur += (latest - last);                         \
+	else                                                    \
+		cur += ((latest + ((uint64_t)1 << 32)) - last); \
+	cur &= UINT_MAX;                                        \
+	last = latest;                                          \
 }

total: 0 errors, 0 warnings, 4 checks, 20 lines checked


More information about the test-report mailing list