Subject: Re: [net-next 1/8] i40e: main driver core

From: Stephen Hemminger <[email-masked]>
Date: Wed, 19 Jun 2013 11:55:42 -0700

On Thu, 13 Jun 2013 20:55:15 -0700
Jeff Kirsher <[email-masked]> wrote:

> +
> +char i40e_driver_name[] = "i40e";

Obviously const

+/* Helper macros for reading the stats registers
+ *
+ * Since the device stats are not reset at PFReset, they likely will not
+ * be zeroed when the driver starts.  We'll save the first values read
+ * and use them as offsets to be subtracted from the raw values in order
+ * to report stats that count from zero.
+ */
+#define I40E_STAT_UPDATE48(hireg, loreg, offset_loaded, offset, stat)     \
+do {                                                                      \
+	u64 new_data;                                                     \
+	new_data = rd64(hw, (loreg));                                     \
+	if (!(offset_loaded))                                             \
+		(offset) = new_data;                                      \
+	if (likely(new_data >= (offset)))                                 \
+		(stat) = new_data - (offset);                             \
+	else                                                              \
+		(stat) = (new_data + ((u64)1 << 48)) - (offset);          \
+	(stat) &= 0xFFFFFFFFFFFFULL;                                      \
+} while (0)

Macro's suck, this could just as well be a function
or maybe a macro that calls function (and go ahead and do string manipulation)