linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] arch/powerpc/platforms/85xx: Add local_irq_restore in error handling code
@ 2008-12-21 20:54 Julia Lawall
  2008-12-30 18:11 ` Kumar Gala
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2008-12-21 20:54 UTC (permalink / raw)
  To: galak, linuxppc-dev, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

There is a call to local_irq_restore in the normal exit case, so it would
seem that there should be one on an error return as well.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression l;
expression E,E1,E2;
@@

local_irq_save(l);
... when != local_irq_restore(l)
    when != spin_unlock_irqrestore(E,l)
    when any
    when strict
(
if (...) { ... when != local_irq_restore(l)
               when != spin_unlock_irqrestore(E1,l)
+   local_irq_restore(l);
    return ...;
}
|
if (...)
+   {local_irq_restore(l);
    return ...;
+   }
|
spin_unlock_irqrestore(E2,l);
|
local_irq_restore(l);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/powerpc/platforms/85xx/smp.c |    1 +
 1 file changed, 1 insertion(+)

diff -u -p a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -58,6 +58,7 @@ smp_85xx_kick_cpu(int nr)
 
 	if (cpu_rel_addr == NULL) {
 		printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr);
+		local_irq_restore(flags);
 		return;
 	}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] arch/powerpc/platforms/85xx: Add local_irq_restore in error handling code
  2008-12-21 20:54 [PATCH 2/2] arch/powerpc/platforms/85xx: Add local_irq_restore in error handling code Julia Lawall
@ 2008-12-30 18:11 ` Kumar Gala
  0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2008-12-30 18:11 UTC (permalink / raw)
  To: Julia Lawall; +Cc: linuxppc-dev, kernel-janitors, linux-kernel


On Dec 21, 2008, at 2:54 PM, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
>
> There is a call to local_irq_restore in the normal exit case, so it  
> would
> seem that there should be one on an error return as well.
>
> The semantic patch that makes this change is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> expression l;
> expression E,E1,E2;
> @@
>
> local_irq_save(l);
> ... when != local_irq_restore(l)
>    when != spin_unlock_irqrestore(E,l)
>    when any
>    when strict
> (
> if (...) { ... when != local_irq_restore(l)
>               when != spin_unlock_irqrestore(E1,l)
> +   local_irq_restore(l);
>    return ...;
> }
> |
> if (...)
> +   {local_irq_restore(l);
>    return ...;
> +   }
> |
> spin_unlock_irqrestore(E2,l);
> |
> local_irq_restore(l);
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> arch/powerpc/platforms/85xx/smp.c |    1 +
> 1 file changed, 1 insertion(+)

applied.

- k

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-30 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-21 20:54 [PATCH 2/2] arch/powerpc/platforms/85xx: Add local_irq_restore in error handling code Julia Lawall
2008-12-30 18:11 ` Kumar Gala

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).