From: Jonathan Cameron <jic23@kernel.org>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
kernel-janitors@vger.kernel.org,
Eric Miao <eric.y.miao@gmail.com>,
Russell King <linux@arm.linux.org.uk>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 16/16] arch/arm/mach-pxa/stargate2.c: Avoid using ARRAY_AND_SIZE(e) as a function argument
Date: Mon, 12 Aug 2013 10:22:34 +0100 [thread overview]
Message-ID: <5208A95A.70606@kernel.org> (raw)
In-Reply-To: <1376239917-15594-17-git-send-email-Julia.Lawall@lip6.fr>
On 08/11/13 17:51, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> 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/)
>
> // <smpl>
> @@
> expression e,f;
> @@
>
> f(...,
> - ARRAY_AND_SIZE(e)
> + e,ARRAY_SIZE(e)
> ,...)
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Thanks,
>
> ---
> Not compiled.
>
> arch/arm/mach-pxa/stargate2.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
> index 62aea3e..adacedd 100644
> --- a/arch/arm/mach-pxa/stargate2.c
> +++ b/arch/arm/mach-pxa/stargate2.c
> @@ -406,7 +406,8 @@ static struct i2c_pxa_platform_data i2c_pdata = {
> static void __init imote2_stargate2_init(void)
> {
>
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(sg2_im2_unified_pin_config));
> + pxa2xx_mfp_config(sg2_im2_unified_pin_config,
> + ARRAY_SIZE(sg2_im2_unified_pin_config));
>
> pxa_set_ffuart_info(NULL);
> pxa_set_btuart_info(NULL);
> @@ -604,7 +605,7 @@ static struct platform_device *imote2_devices[] = {
>
> static void __init imote2_init(void)
> {
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
> + pxa2xx_mfp_config(imote2_pin_config, ARRAY_SIZE(imote2_pin_config));
>
> imote2_stargate2_init();
>
> @@ -983,13 +984,15 @@ static void __init stargate2_init(void)
> prior to connecting the MFP stuff up. */
> __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR);
>
> - pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
> + pxa2xx_mfp_config(stargate2_pin_config,
> + ARRAY_SIZE(stargate2_pin_config));
>
> imote2_stargate2_init();
>
> - platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
> + platform_add_devices(stargate2_devices, ARRAY_SIZE(stargate2_devices));
>
> - i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info));
> + i2c_register_board_info(0, stargate2_i2c_board_info,
> + ARRAY_SIZE(stargate2_i2c_board_info));
> i2c_register_board_info(1, stargate2_pwr_i2c_board_info,
> ARRAY_SIZE(stargate2_pwr_i2c_board_info));
>
>
prev parent reply other threads:[~2013-08-12 8:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-11 16:51 [PATCH 0/16] Avoid using ARRAY_AND_SIZE(e) as a function argument Julia Lawall
2013-08-11 16:51 ` [PATCH 1/16] sound/soc/pxa/mioa701_wm9713.c: " Julia Lawall
2013-08-11 18:06 ` Mark Brown
2013-08-11 16:51 ` [PATCH 2/16] arch/arm/mach-pxa: " Julia Lawall
2013-08-11 16:51 ` [PATCH 3/16] arch/arm/mach-ux500/cpu-db8500.c: " Julia Lawall
2013-08-20 9:13 ` Linus Walleij
2013-08-11 16:51 ` [PATCH 4/16] arch/arm/mach-pxa/z2.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 5/16] arch/arm/mach-pxa/vpac270.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 6/16] arch/arm/mach-pxa: " Julia Lawall
2013-08-11 16:51 ` [PATCH 7/16] arch/arm/mach-pxa/colibri-pxa270-income.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 8/16] arch/arm/mach-pxa/palmz72.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 9/16] arch/arm/mach-pxa/mioa701.c: " Julia Lawall
2013-08-12 19:58 ` Robert Jarzmik
2013-08-12 20:24 ` Julia Lawall
2013-08-11 16:51 ` [PATCH 10/16] arch/arm/mach-mmp: " Julia Lawall
2013-08-11 16:51 ` [PATCH 11/16] arch/arm/mach-pxa/palmtreo.c: " Julia Lawall
2013-08-13 0:34 ` Tomas Cech
2013-08-11 16:51 ` [PATCH 12/16] drivers/cpufreq/pxa3xx-cpufreq.c: " Julia Lawall
2013-08-12 5:26 ` Viresh Kumar
2013-08-12 5:45 ` Julia Lawall
2013-08-12 5:46 ` Viresh Kumar
2013-08-12 5:48 ` Julia Lawall
2013-08-12 5:50 ` Viresh Kumar
2013-08-13 13:22 ` Rafael J. Wysocki
2013-08-11 16:51 ` [PATCH 13/16] arch/arm/mach-pxa/hx4700.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 14/16] arch/arm/mach-pxa/ezx.c: " Julia Lawall
2013-08-11 16:51 ` [PATCH 15/16] arch/arm/mach-kirkwood: " Julia Lawall
2013-08-12 19:14 ` Jason Cooper
2013-08-11 16:51 ` [PATCH 16/16] arch/arm/mach-pxa/stargate2.c: " Julia Lawall
2013-08-12 9:22 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5208A95A.70606@kernel.org \
--to=jic23@kernel.org \
--cc=Julia.Lawall@lip6.fr \
--cc=eric.y.miao@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=jic23@cam.ac.uk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).