From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759230AbXLUB6h (ORCPT ); Thu, 20 Dec 2007 20:58:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755614AbXLUB5v (ORCPT ); Thu, 20 Dec 2007 20:57:51 -0500 Received: from smtp.polymtl.ca ([132.207.4.11]:35412 "EHLO smtp.polymtl.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755237AbXLUB5t (ORCPT ); Thu, 20 Dec 2007 20:57:49 -0500 Message-Id: <20071221015723.765639544@polymtl.ca> References: <20071221015438.433195466@polymtl.ca> User-Agent: quilt/0.46-1 Date: Thu, 20 Dec 2007 20:54:42 -0500 From: Mathieu Desnoyers To: akpm@linux-foundation.org, Ingo Molnar , linux-kernel@vger.kernel.org Cc: Mathieu Desnoyers Subject: [patch 04/24] Add INIT_ARRAY() to kernel.h Content-Disposition: inline; filename=declare-array.patch X-Poly-FromMTA: (dijkstra.casi.polymtl.ca [132.207.72.10]) at Fri, 21 Dec 2007 01:57:28 +0000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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-11-13 09:25:29.000000000 -0500 +++ linux-2.6-lttng/include/linux/kernel.h 2007-11-13 09:45:38.000000000 -0500 @@ -421,4 +421,6 @@ struct sysinfo { #define NUMA_BUILD 0 #endif +#define INIT_ARRAY(type, val, len) ((type [len]) { [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