* [PATCH] lockdep: remove unneccesary assignment in loop and the viarable
@ 2013-04-04 7:01 Hong Zhiguo
2013-04-10 9:24 ` [tip:core/locking] lockdep: Remove unnecessary 'hlock_next' variable tip-bot for Hong Zhiguo
0 siblings, 1 reply; 2+ messages in thread
From: Hong Zhiguo @ 2013-04-04 7:01 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo, peterz
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
---
kernel/lockdep.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 259db20..0f26597 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2000,7 +2000,7 @@ static inline int lookup_chain_cache(struct task_struct *curr,
struct lock_class *class = hlock_class(hlock);
struct list_head *hash_head = chainhashentry(chain_key);
struct lock_chain *chain;
- struct held_lock *hlock_curr, *hlock_next;
+ struct held_lock *hlock_curr;
int i, j;
/*
@@ -2057,12 +2057,10 @@ cache_hit:
chain->chain_key = chain_key;
chain->irq_context = hlock->irq_context;
/* Find the first held_lock of current chain */
- hlock_next = hlock;
for (i = curr->lockdep_depth - 1; i >= 0; i--) {
hlock_curr = curr->held_locks + i;
- if (hlock_curr->irq_context != hlock_next->irq_context)
+ if (hlock_curr->irq_context != hlock->irq_context)
break;
- hlock_next = hlock;
}
i++;
chain->depth = curr->lockdep_depth + 1 - i;
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:core/locking] lockdep: Remove unnecessary 'hlock_next' variable
2013-04-04 7:01 [PATCH] lockdep: remove unneccesary assignment in loop and the viarable Hong Zhiguo
@ 2013-04-10 9:24 ` tip-bot for Hong Zhiguo
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Hong Zhiguo @ 2013-04-10 9:24 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, honkiko, tglx
Commit-ID: bfaf4af8abf92b883c04d137a0c18245cc9d51a2
Gitweb: http://git.kernel.org/tip/bfaf4af8abf92b883c04d137a0c18245cc9d51a2
Author: Hong Zhiguo <honkiko@gmail.com>
AuthorDate: Thu, 4 Apr 2013 15:01:21 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 8 Apr 2013 17:39:34 +0200
lockdep: Remove unnecessary 'hlock_next' variable
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1365058881-4044-1-git-send-email-honkiko@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/lockdep.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 8a0efac..e5dedda 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2000,7 +2000,7 @@ static inline int lookup_chain_cache(struct task_struct *curr,
struct lock_class *class = hlock_class(hlock);
struct list_head *hash_head = chainhashentry(chain_key);
struct lock_chain *chain;
- struct held_lock *hlock_curr, *hlock_next;
+ struct held_lock *hlock_curr;
int i, j;
/*
@@ -2057,12 +2057,10 @@ cache_hit:
chain->chain_key = chain_key;
chain->irq_context = hlock->irq_context;
/* Find the first held_lock of current chain */
- hlock_next = hlock;
for (i = curr->lockdep_depth - 1; i >= 0; i--) {
hlock_curr = curr->held_locks + i;
- if (hlock_curr->irq_context != hlock_next->irq_context)
+ if (hlock_curr->irq_context != hlock->irq_context)
break;
- hlock_next = hlock;
}
i++;
chain->depth = curr->lockdep_depth + 1 - i;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-10 9:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04 7:01 [PATCH] lockdep: remove unneccesary assignment in loop and the viarable Hong Zhiguo
2013-04-10 9:24 ` [tip:core/locking] lockdep: Remove unnecessary 'hlock_next' variable tip-bot for Hong Zhiguo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome