All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Tejun Heo" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Imran Khan <imran.f.khan@oracle.com>,
	Chengming Zhou <zhouchengming@bytedance.com>,
	Tejun Heo <tj@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/psi] kernfs: Drop unnecessary "mutex" local variable initialization
Date: Fri, 09 Sep 2022 14:00:33 -0000	[thread overview]
Message-ID: <166273203331.401.751164502927343198.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220828050440.734579-3-tj@kernel.org>

The following commit has been merged into the sched/psi branch of tip:

Commit-ID:     b52c2379c38ffa49cbf10e30abc9dc4f9c051d41
Gitweb:        https://git.kernel.org/tip/b52c2379c38ffa49cbf10e30abc9dc4f9c051d41
Author:        Tejun Heo <tj@kernel.org>
AuthorDate:    Sat, 27 Aug 2022 19:04:33 -10:00
Committer:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CommitterDate: Thu, 01 Sep 2022 18:08:44 +02:00

kernfs: Drop unnecessary "mutex" local variable initialization

These are unnecessary and unconventional. Remove them. Also move variable
declaration into the block that it's used. No functional changes.

Cc: Imran Khan <imran.f.khan@oracle.com>
Tested-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220828050440.734579-3-tj@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/kernfs/file.c |  9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 32b16fe..6437f7c 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -555,7 +555,7 @@ static int kernfs_get_open_node(struct kernfs_node *kn,
 				struct kernfs_open_file *of)
 {
 	struct kernfs_open_node *on, *new_on = NULL;
-	struct mutex *mutex = NULL;
+	struct mutex *mutex;
 
 	mutex = kernfs_open_file_mutex_lock(kn);
 	on = kernfs_deref_open_node_locked(kn);
@@ -599,7 +599,7 @@ static void kernfs_unlink_open_file(struct kernfs_node *kn,
 				 struct kernfs_open_file *of)
 {
 	struct kernfs_open_node *on;
-	struct mutex *mutex = NULL;
+	struct mutex *mutex;
 
 	mutex = kernfs_open_file_mutex_lock(kn);
 
@@ -776,9 +776,10 @@ static int kernfs_fop_release(struct inode *inode, struct file *filp)
 {
 	struct kernfs_node *kn = inode->i_private;
 	struct kernfs_open_file *of = kernfs_of(filp);
-	struct mutex *mutex = NULL;
 
 	if (kn->flags & KERNFS_HAS_RELEASE) {
+		struct mutex *mutex;
+
 		mutex = kernfs_open_file_mutex_lock(kn);
 		kernfs_release_file(kn, of);
 		mutex_unlock(mutex);
@@ -796,7 +797,7 @@ void kernfs_drain_open_files(struct kernfs_node *kn)
 {
 	struct kernfs_open_node *on;
 	struct kernfs_open_file *of;
-	struct mutex *mutex = NULL;
+	struct mutex *mutex;
 
 	if (!(kn->flags & (KERNFS_HAS_MMAP | KERNFS_HAS_RELEASE)))
 		return;

  reply	other threads:[~2022-09-09 14:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28  5:04 [PATCHSET v2 for-6.1] kernfs, cgroup: implement kernfs_show() and cgroup_file_show() Tejun Heo
2022-08-28  5:04 ` [PATCH 1/9] kernfs: Simply by replacing kernfs_deref_open_node() with of_on() Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 2/9] kernfs: Drop unnecessary "mutex" local variable initialization Tejun Heo
2022-09-09 14:00   ` tip-bot2 for Tejun Heo [this message]
2022-08-28  5:04 ` [PATCH 3/9] kernfs: Refactor kernfs_get_open_node() Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 4/9] kernfs: Skip kernfs_drain_open_files() more aggressively Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 5/9] kernfs: Improve kernfs_drain() and always call on removal Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 6/9] kernfs: Add KERNFS_REMOVING flags Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 7/9] kernfs: Factor out kernfs_activate_one() Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 8/9] kernfs: Implement kernfs_show() Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  5:04 ` [PATCH 9/9] cgroup: Implement cgroup_file_show() Tejun Heo
2022-09-09 14:00   ` [tip: sched/psi] " tip-bot2 for Tejun Heo
2022-08-28  8:33 ` [PATCHSET v2 for-6.1] kernfs, cgroup: implement kernfs_show() and cgroup_file_show() Chengming Zhou

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=166273203331.401.751164502927343198.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=imran.f.khan@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    --cc=zhouchengming@bytedance.com \
    /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.