From patchwork Sun Aug 11 16:51:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 2842750 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6694E9F271 for ; Sun, 11 Aug 2013 17:21:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D0FC2020E for ; Sun, 11 Aug 2013 17:21:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 220F8201EC for ; Sun, 11 Aug 2013 17:21:28 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8YvV-0008S1-R3; Sun, 11 Aug 2013 16:55:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Yua-0005gH-7q; Sun, 11 Aug 2013 16:54:36 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Ysr-0005Qk-D7 for linux-arm-kernel@lists.infradead.org; Sun, 11 Aug 2013 16:52:52 +0000 X-IronPort-AV: E=Sophos;i="4.89,857,1367964000"; d="scan'208";a="23717958" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Aug 2013 18:52:02 +0200 From: Julia Lawall To: Daniel Ribeiro Subject: [PATCH 14/16] arch/arm/mach-pxa/ezx.c: Avoid using ARRAY_AND_SIZE(e) as a function argument Date: Sun, 11 Aug 2013 18:51:55 +0200 Message-Id: <1376239917-15594-15-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1376239917-15594-1-git-send-email-Julia.Lawall@lip6.fr> References: <1376239917-15594-1-git-send-email-Julia.Lawall@lip6.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130811_125249_755327_0C85AB76 X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.1 (------) Cc: Stefan Schmidt , openezx-devel@lists.openezx.org, Eric Miao , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Haojian Zhuang , linux-arm-kernel@lists.infradead.org, Russell King , Harald Welte X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall Replace ARRAY_AND_SIZE(e) in function argument position to avoid hiding the arity of the called function. The semantic match that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,f; @@ f(..., - ARRAY_AND_SIZE(e) + e,ARRAY_SIZE(e) ,...) // Signed-off-by: Julia Lawall --- Not compiled. arch/arm/mach-pxa/ezx.c | 75 +++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index fe2eb83..879cb1b 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c @@ -797,9 +797,9 @@ static struct platform_device *a780_devices[] __initdata = { static void __init a780_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen1_pin_config, ARRAY_SIZE(gen1_pin_config)); + pxa2xx_mfp_config(a780_pin_config, ARRAY_SIZE(a780_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); @@ -816,8 +816,8 @@ static void __init a780_init(void) platform_device_register(&a780_camera); } - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(a780_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(a780_devices, ARRAY_SIZE(a780_devices)); } MACHINE_START(EZX_A780, "Motorola EZX A780") @@ -868,23 +868,24 @@ static struct platform_device *e680_devices[] __initdata = { static void __init e680_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen1_pin_config, ARRAY_SIZE(gen1_pin_config)); + pxa2xx_mfp_config(e680_pin_config, ARRAY_SIZE(e680_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info)); + i2c_register_board_info(0, e680_i2c_board_info, + ARRAY_SIZE(e680_i2c_board_info)); pxa_set_fb_info(NULL, &ezx_fb_info_1); pxa_set_keypad_info(&e680_keypad_platform_data); - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(e680_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(e680_devices, ARRAY_SIZE(e680_devices)); } MACHINE_START(EZX_E680, "Motorola EZX E680") @@ -935,23 +936,24 @@ static struct platform_device *a1200_devices[] __initdata = { static void __init a1200_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen2_pin_config, ARRAY_SIZE(gen2_pin_config)); + pxa2xx_mfp_config(a1200_pin_config, ARRAY_SIZE(a1200_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info)); + i2c_register_board_info(0, a1200_i2c_board_info, + ARRAY_SIZE(a1200_i2c_board_info)); pxa_set_fb_info(NULL, &ezx_fb_info_2); pxa_set_keypad_info(&a1200_keypad_platform_data); - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(a1200_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(a1200_devices, ARRAY_SIZE(a1200_devices)); } MACHINE_START(EZX_A1200, "Motorola EZX A1200") @@ -1122,16 +1124,17 @@ static struct platform_device *a910_devices[] __initdata = { static void __init a910_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen2_pin_config, ARRAY_SIZE(gen2_pin_config)); + pxa2xx_mfp_config(a910_pin_config, ARRAY_SIZE(a910_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info)); + i2c_register_board_info(0, a910_i2c_board_info, + ARRAY_SIZE(a910_i2c_board_info)); pxa_set_fb_info(NULL, &ezx_fb_info_2); @@ -1142,8 +1145,8 @@ static void __init a910_init(void) platform_device_register(&a910_camera); } - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(a910_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(a910_devices, ARRAY_SIZE(a910_devices)); } MACHINE_START(EZX_A910, "Motorola EZX A910") @@ -1194,23 +1197,24 @@ static struct platform_device *e6_devices[] __initdata = { static void __init e6_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen2_pin_config, ARRAY_SIZE(gen2_pin_config)); + pxa2xx_mfp_config(e6_pin_config, ARRAY_SIZE(e6_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info)); + i2c_register_board_info(0, e6_i2c_board_info, + ARRAY_SIZE(e6_i2c_board_info)); pxa_set_fb_info(NULL, &ezx_fb_info_2); pxa_set_keypad_info(&e6_keypad_platform_data); - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(e6_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(e6_devices, ARRAY_SIZE(e6_devices)); } MACHINE_START(EZX_E6, "Motorola EZX E6") @@ -1235,23 +1239,24 @@ static struct platform_device *e2_devices[] __initdata = { static void __init e2_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); - pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config)); + pxa2xx_mfp_config(ezx_pin_config, ARRAY_SIZE(ezx_pin_config)); + pxa2xx_mfp_config(gen2_pin_config, ARRAY_SIZE(gen2_pin_config)); + pxa2xx_mfp_config(e2_pin_config, ARRAY_SIZE(e2_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info)); + i2c_register_board_info(0, e2_i2c_board_info, + ARRAY_SIZE(e2_i2c_board_info)); pxa_set_fb_info(NULL, &ezx_fb_info_2); pxa_set_keypad_info(&e2_keypad_platform_data); - platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); - platform_add_devices(ARRAY_AND_SIZE(e2_devices)); + platform_add_devices(ezx_devices, ARRAY_SIZE(ezx_devices)); + platform_add_devices(e2_devices, ARRAY_SIZE(e2_devices)); } MACHINE_START(EZX_E2, "Motorola EZX E2")