Array initializers in the body of a function causes unbalanced brackets which
syntax highlighting editors such as vim have problems with. Fix this by creating
the INIT_ARRAY() macro.
It is used to declare arguments passed as function parameters such as:
text_poke(addr, INIT_ARRAY(unsigned char, 0xf0, len), len);
Changelog :
- [len] -> []
- Remove whitespaces.
- Fixed Jan's suggestion which was not checkpatch.pl-safe.
- More informative patch header.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Jan Engelhardt <jengelh@computergmbh.de>
CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
include/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)
Index: linux-2.6-lttng.mm/include/linux/kernel.h
===================================================================
--- linux-2.6-lttng.mm.orig/include/linux/kernel.h 2008-01-24 15:53:04.000000000 -0500
+++ linux-2.6-lttng.mm/include/linux/kernel.h 2008-01-24 15:53:25.000000000 -0500
@@ -423,4 +423,6 @@ struct sysinfo {
#define NUMA_BUILD 0
#endif
+#define INIT_ARRAY(type, val, len) ((type[]) {[0 ... (len)-1] = (val)})
+
#endif
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
| Andi Kleen | [PATCH] [3/22] x86_64: Kill temp boot pmds |
| Alan Cox | Re: [PATCH][RFC] 4K stacks default, not a debug thing any more...? |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
git: | |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 05/37] dccp: Cleanup routines for feature negotiation |
| Brandeburg, Jesse | RE: [PATCH] e1000e: test MSI interrupts |
