* [PATCH] arch/arm/mach-s3c24xx/mach-h1940.c: delete double assignment
@ 2012-09-12 19:28 Julia Lawall
2012-09-14 4:03 ` kgene
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2012-09-12 19:28 UTC (permalink / raw)
To: Ben Dooks
Cc: kernel-janitors, Kukjin Kim, Russell King, linux-arm-kernel,
linux-samsung-soc, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Delete successive assignments to the same location.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression i;
@@
*i = ...;
i = ...;
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
Not compiled, and this may change the behavior of the code. Without this
change, check_gpio2 could possibly be used uninitialized later.
arch/arm/mach-s3c24xx/mach-h1940.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index bb8d008..477778c 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -380,7 +380,7 @@ int h1940_led_blink_set(unsigned gpio, int state,
default:
blink_gpio = S3C2410_GPA(3);
check_gpio1 = S3C2410_GPA(1);
- check_gpio1 = S3C2410_GPA(7);
+ check_gpio2 = S3C2410_GPA(7);
break;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] arch/arm/mach-s3c24xx/mach-h1940.c: delete double assignment
2012-09-12 19:28 [PATCH] arch/arm/mach-s3c24xx/mach-h1940.c: delete double assignment Julia Lawall
@ 2012-09-14 4:03 ` kgene
0 siblings, 0 replies; 2+ messages in thread
From: kgene @ 2012-09-14 4:03 UTC (permalink / raw)
To: 'Julia Lawall', 'Ben Dooks'
Cc: kernel-janitors, 'Russell King',
linux-arm-kernel, linux-samsung-soc, linux-kernel
Julia Lawall wrote:
>
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Delete successive assignments to the same location.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression i;
> @@
>
> *i = ...;
> i = ...;
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> Not compiled, and this may change the behavior of the code. Without this
> change, check_gpio2 could possibly be used uninitialized later.
>
> arch/arm/mach-s3c24xx/mach-h1940.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-
> s3c24xx/mach-h1940.c
> index bb8d008..477778c 100644
> --- a/arch/arm/mach-s3c24xx/mach-h1940.c
> +++ b/arch/arm/mach-s3c24xx/mach-h1940.c
> @@ -380,7 +380,7 @@ int h1940_led_blink_set(unsigned gpio, int state,
> default:
> blink_gpio = S3C2410_GPA(3);
> check_gpio1 = S3C2410_GPA(1);
> - check_gpio1 = S3C2410_GPA(7);
> + check_gpio2 = S3C2410_GPA(7);
> break;
> }
>
Applied, thanks.
K-Gene <kgene@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-14 4:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 19:28 [PATCH] arch/arm/mach-s3c24xx/mach-h1940.c: delete double assignment Julia Lawall
2012-09-14 4:03 ` kgene
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).