2013-08-13 07:17:04

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 1/5 v2] drivers/gpio/gpio-omap.c: convert comma to semicolon

From: Julia Lawall <[email protected]>

Replace a comma between expression statements by a semicolon. This changes
the semantics of the code, but given the current indentation appears to be
what is intended.

A simplified version of the semantic patch that performs this
transformation is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@

e1
-,
+;
e2;
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>

---
Not tested. The first version did a different transformation to avoid
changing the semantics. This one leaves the layout as it is, but changes
the semantics.

drivers/gpio/gpio-omap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index dfeb3a3..9f19ec9 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1030,7 +1030,7 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
ct->chip.irq_set_type = gpio_irq_type;

if (bank->regs->wkup_en)
- ct->chip.irq_set_wake = gpio_wake_enable,
+ ct->chip.irq_set_wake = gpio_wake_enable;

ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,


2013-08-13 15:07:52

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 1/5 v2] drivers/gpio/gpio-omap.c: convert comma to semicolon

Julia Lawall <[email protected]> writes:

> From: Julia Lawall <[email protected]>
>
> Replace a comma between expression statements by a semicolon. This changes
> the semantics of the code, but given the current indentation appears to be
> what is intended.
>
> A simplified version of the semantic patch that performs this
> transformation is as follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> expression e1,e2,e;
> type T;
> identifier i;
> @@
>
> e1
> -,
> +;
> e2;
> // </smpl>
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> Not tested. The first version did a different transformation to avoid
> changing the semantics. This one leaves the layout as it is, but changes
> the semantics.

This is the right one, the previous semantics were wrong due to a
copy/paste error.

Acked-by: Kevin Hilman <[email protected]>

> drivers/gpio/gpio-omap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index dfeb3a3..9f19ec9 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1030,7 +1030,7 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
> ct->chip.irq_set_type = gpio_irq_type;
>
> if (bank->regs->wkup_en)
> - ct->chip.irq_set_wake = gpio_wake_enable,
> + ct->chip.irq_set_wake = gpio_wake_enable;
>
> ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
> irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2013-08-16 15:15:24

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/5 v2] drivers/gpio/gpio-omap.c: convert comma to semicolon

On Tue, Aug 13, 2013 at 9:16 AM, Julia Lawall <[email protected]> wrote:

> From: Julia Lawall <[email protected]>
>
> Replace a comma between expression statements by a semicolon. This changes
> the semantics of the code, but given the current indentation appears to be
> what is intended.

Aha there is the right patch, sorry for the noise.

Patch applied with Kevin's ACK.

Yours,
Linus Walleij