[patch 04/11] Add INIT_ARRAY() to kernel.h

Mathieu Desnoyers
2007-09-18T21:44:50Z

[-- Attachment #1: declare-array.patch --]
[-- Type: text/plain, Size: 967 bytes --]

Add initialization of an array, which needs brackets that would pollute kernel
code, to kernel.h. It is used to declare arguments passed as function parameters
such as:
text_poke(addr, INIT_ARRAY(unsigned char, 0xf0, len), len);

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
---
include/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)

Index: linux-2.6-lttng/include/linux/kernel.h
===================================================================
--- linux-2.6-lttng.orig/include/linux/kernel.h 2007-09-18 10:09:15.000000000 -0400
+++ linux-2.6-lttng/include/linux/kernel.h 2007-09-18 13:12:34.000000000 -0400
@@ -400,4 +400,6 @@ struct sysinfo {
#define NUMA_BUILD 0
#endif

+#define INIT_ARRAY(type, val, len) ((type [len]){ [0 ... (len)-1] = (val) })
+
#endif