The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2, RESEND 02/10] f2fs: convert to kobject_del_and_put()
Date: Sun, 19 Mar 2023 17:26:33 +0800	[thread overview]
Message-ID: <20230319092641.41917-2-frank.li@vivo.com> (raw)
In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com>

Use kobject_del_and_put() to simplify code.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/sysfs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 9ddc6ee19433..b455afc12cfc 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -1478,14 +1478,11 @@ void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi)
 		remove_proc_entry(sbi->sb->s_id, f2fs_proc_root);
 	}
 
-	kobject_del(&sbi->s_stat_kobj);
-	kobject_put(&sbi->s_stat_kobj);
+	kobject_del_and_put(&sbi->s_stat_kobj);
 	wait_for_completion(&sbi->s_stat_kobj_unregister);
-	kobject_del(&sbi->s_feature_list_kobj);
-	kobject_put(&sbi->s_feature_list_kobj);
+	kobject_del_and_put(&sbi->s_feature_list_kobj);
 	wait_for_completion(&sbi->s_feature_list_kobj_unregister);
 
-	kobject_del(&sbi->s_kobj);
-	kobject_put(&sbi->s_kobj);
+	kobject_del_and_put(&sbi->s_kobj);
 	wait_for_completion(&sbi->s_kobj_unregister);
 }
-- 
2.35.1


  reply	other threads:[~2023-03-19  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19  9:26 [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put() Yangtao Li
2023-03-19  9:26 ` Yangtao Li [this message]
2023-03-19  9:26 ` [PATCH v2, RESEND 03/10] erofs: convert to kobject_del_and_put() Yangtao Li
2023-03-19  9:26 ` [PATCH v2, RESEND 04/10] zonefs: " Yangtao Li
2023-03-19 21:42   ` Damien Le Moal
2023-03-19  9:26 ` [PATCH v2, RESEND 05/10] ubifs: " Yangtao Li
2023-03-20  2:55   ` Zhihao Cheng
2023-03-19  9:26 ` [PATCH v2, RESEND 06/10] btrfs: " Yangtao Li
2023-03-20 15:54   ` David Sterba
2023-03-19  9:26 ` [PATCH v2, RESEND 07/10] xfs: " Yangtao Li
2023-03-20 14:58   ` Darrick J. Wong
2023-03-19  9:26 ` [PATCH v2, RESEND 08/10] ocfs2: " Yangtao Li
2023-03-20  3:35   ` Joseph Qi
2023-03-19  9:26 ` [PATCH v2, RESEND 09/10] nfs: " Yangtao Li
2023-03-19  9:26 ` [PATCH v2, RESEND 10/10] nilfs2: " Yangtao Li

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=20230319092641.41917-2-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=chao@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox