aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-06-20 07:24:54 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-06-21 00:46:53 -0400
commit0e6f989ba83e6fa64e979d3488f01670b8be7959 (patch)
tree867fd6607fb419ab3a6250c38ec7e966131c145c
parent9973e38575070b70c68bad177fb5056548fea349 (diff)
arch/sh/mm: Eliminate a double lock
The function begins and ends with a read_lock. The latter is changed to a read_unlock. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @locked@ expression E1; position p; @@ read_lock(E1@p,...); @r exists@ expression x <= locked.E1; expression locked.E1; expression E2; identifier lock; position locked.p,p1,p2; @@ *lock@p1 (E1@p,...); ... when != E1 when != \(x = E2\|&x\) *lock@p2 (E1,...); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/mm/pmb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 18623ba751b3..6379091a1647 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -770,7 +770,7 @@ static void __init pmb_resize(void)
770 spin_unlock_irqrestore(&pmbe->lock, flags); 770 spin_unlock_irqrestore(&pmbe->lock, flags);
771 } 771 }
772 772
773 read_lock(&pmb_rwlock); 773 read_unlock(&pmb_rwlock);
774} 774}
775#endif 775#endif
776 776