[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 09 Sep 2022 14:00:33 -0000
From: "tip-bot2 for Tejun Heo" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Imran Khan <imran.f.khan@...cle.com>,
Chengming Zhou <zhouchengming@...edance.com>,
Tejun Heo <tj@...nel.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: sched/psi] kernfs: Drop unnecessary "mutex" local variable
initialization
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@...nel.org>
AuthorDate: Sat, 27 Aug 2022 19:04:33 -10:00
Committer: Greg Kroah-Hartman <gregkh@...uxfoundation.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@...cle.com>
Tested-by: Chengming Zhou <zhouchengming@...edance.com>
Reviewed-by: Chengming Zhou <zhouchengming@...edance.com>
Signed-off-by: Tejun Heo <tj@...nel.org>
Link: https://lore.kernel.org/r/20220828050440.734579-3-tj@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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;
Powered by blists - more mailing lists