All of lore.kernel.org
 help / color / mirror / Atom feed
From: wuchi <wuchi.zero@gmail.com>
To: peterz@infradead.org, mingo@redhat.com, will@kernel.org,
	longman@redhat.com, boqun.feng@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] locking/lockdep: Remove unused variable in __lockdep_count*()
Date: Sun, 30 Oct 2022 19:17:59 +0800	[thread overview]
Message-ID: <20221030111759.95092-1-wuchi.zero@gmail.com> (raw)

The target_entry variable will never be referenced because the
function noop_count() always returns false in __bfs().
So just remove that.

Signed-off-by: wuchi <wuchi.zero@gmail.com>
---
 kernel/locking/lockdep.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e3375bc40dad..04d2ce5d0215 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2075,9 +2075,8 @@ static bool noop_count(struct lock_list *entry, void *data)
 static unsigned long __lockdep_count_forward_deps(struct lock_list *this)
 {
 	unsigned long  count = 0;
-	struct lock_list *target_entry;
 
-	__bfs_forwards(this, (void *)&count, noop_count, NULL, &target_entry);
+	__bfs_forwards(this, (void *)&count, noop_count, NULL, NULL);
 
 	return count;
 }
@@ -2100,9 +2099,8 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)
 static unsigned long __lockdep_count_backward_deps(struct lock_list *this)
 {
 	unsigned long  count = 0;
-	struct lock_list *target_entry;
 
-	__bfs_backwards(this, (void *)&count, noop_count, NULL, &target_entry);
+	__bfs_backwards(this, (void *)&count, noop_count, NULL, NULL);
 
 	return count;
 }
-- 
2.20.1


             reply	other threads:[~2022-10-30 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 11:17 wuchi [this message]
2022-10-30 15:20 ` [PATCH] locking/lockdep: Remove unused variable in __lockdep_count*() Waiman Long
2022-10-31  5:55   ` chi wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221030111759.95092-1-wuchi.zero@gmail.com \
    --to=wuchi.zero@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.