Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3914C7618E for ; Mon, 20 Mar 2023 02:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjCTC4M (ORCPT ); Sun, 19 Mar 2023 22:56:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjCTC4H (ORCPT ); Sun, 19 Mar 2023 22:56:07 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E44A0F745 for ; Sun, 19 Mar 2023 19:55:54 -0700 (PDT) Received: from kwepemm600013.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PfzqL3qpzzrTsP; Mon, 20 Mar 2023 10:54:54 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 20 Mar 2023 10:55:52 +0800 Subject: Re: [PATCH v2, RESEND 05/10] ubifs: convert to kobject_del_and_put() To: Yangtao Li , Richard Weinberger CC: Greg Kroah-Hartman , "Rafael J. Wysocki" , , References: <20230319092641.41917-1-frank.li@vivo.com> <20230319092641.41917-5-frank.li@vivo.com> From: Zhihao Cheng Message-ID: <9d8258af-4f27-7897-26f9-32dd8ca9b20c@huawei.com> Date: Mon, 20 Mar 2023 10:55:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20230319092641.41917-5-frank.li@vivo.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.46] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yangtao, > Use kobject_del_and_put() to simplify code. > > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Signed-off-by: Yangtao Li > --- > fs/ubifs/sysfs.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c > index 1c958148bb87..9571718e61a9 100644 > --- a/fs/ubifs/sysfs.c > +++ b/fs/ubifs/sysfs.c > @@ -130,8 +130,7 @@ int ubifs_sysfs_register(struct ubifs_info *c) > > void ubifs_sysfs_unregister(struct ubifs_info *c) > { > - kobject_del(&c->kobj); > - kobject_put(&c->kobj); > + kobject_del_and_put(&c->kobj); > wait_for_completion(&c->kobj_unregister); > > kfree(c->stats); > Maybe you can send the entire patchset to linux-mtd next time, I can only see patch 5 from the maillist. After confirming from other website(https://www.spinics.net/lists/kernel/msg4727274.html) I see you instroduced the implementation of kobject_del_and_put(). I have no objections if other modules can accept the kobject_del_and_put().