Search Linux Wireless

[PATCH 05/11] qca-swiss-army-knife: add a macro for de-duplicating initval tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Felix Fietkau <nbd@xxxxxxxxxxx>
---
 tools/initvals/initvals.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tools/initvals/initvals.c b/tools/initvals/initvals.c
index 437dfc5..b655a4c 100644
--- a/tools/initvals/initvals.c
+++ b/tools/initvals/initvals.c
@@ -296,6 +296,22 @@ typedef long long unsigned int u64;
 
 #endif /* ATHEROS */
 
+#define INI_PRINT_DUP(_array, _ref) do { \
+	if (check) { \
+		char *sha1sum; \
+		sha1sum = ath9k_hw_check_initval((const u32 *) &_array,\
+						ARRAY_SIZE(_array), ARRAY_SIZE((_array)[0])); \
+		printf("%s        "#_array"\n", sha1sum); \
+	} else { \
+		if (sizeof(_ref) == sizeof(_array) && !memcmp(&_ref, &_array, sizeof(_ref))) { \
+			printf("#define " #_array " " #_ref "\n\n"); \
+			break; \
+		} \
+		ath9k_hw_print_initval(#_array, (const u32 *) _array, \
+				       ARRAY_SIZE(_array), ARRAY_SIZE((_array)[0]), false); \
+	} \
+    } while (0)
+
 #define INI_PRINT(_array) do { \
 	if (check) { \
 		char *sha1sum; \
-- 
1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux