From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74A0AC04FF3 for ; Mon, 24 May 2021 09:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5322461209 for ; Mon, 24 May 2021 09:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232526AbhEXJmu (ORCPT ); Mon, 24 May 2021 05:42:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:38946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbhEXJms (ORCPT ); Mon, 24 May 2021 05:42:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3C876117A; Mon, 24 May 2021 09:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621849281; bh=5MMWvN7bssAO7WTG5yIeQV/YR8JwXVwiZ4jViKGuU6Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hDGEcWbozve4vWL05kciC3auc3TJg+d/RuIS7dHTXIoVCmsxxYHKs3kL/3nuvPQfJ lli01AAag/ZeXa12z2J9XsspgFN4bKZgwarPs1ewyuuT6ZqsemcKdzDDI6PoDLOyLi xMGMWPNAs+lu18D4aWOWNcVQA2j7NPsWPVlDAV7k= Date: Mon, 24 May 2021 11:41:19 +0200 From: Greg Kroah-Hartman To: Geert Uytterhoeven Cc: Linux Kernel Mailing List Subject: Re: [PATCH] debugfs: remove return value of debugfs_create_bool() Message-ID: References: <20210521184519.1356639-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 11:11:32AM +0200, Geert Uytterhoeven wrote: > Hi Greg, > > Thanks for your patch! > > On Fri, May 21, 2021 at 10:28 PM Greg Kroah-Hartman > wrote: > > No one checks the return value of debugfs_create_bool(), as it's not > > needed, so make the return value void, so that no one tries to do so in > > Please explain in the patch description why it is not needed. Because you just do not need it, like almost all other debugfs calls now. > > the future. > > > > Signed-off-by: Greg Kroah-Hartman > > > --- a/fs/debugfs/file.c > > +++ b/fs/debugfs/file.c > > @@ -836,20 +836,11 @@ static const struct file_operations fops_bool_wo = { > > * This function creates a file in debugfs with the given name that > > * contains the value of the variable @value. If the @mode variable is so > > * set, it can be read from, and written to. > > - * > > - * This function will return a pointer to a dentry if it succeeds. This > > - * pointer must be passed to the debugfs_remove() function when the file is > > - * to be removed (no automatic cleanup happens if your module is unloaded, > > Why isn't the above no longer true? Because there is no return value. > Are we no longer allowed to remove individual debugfs entries? It's not something that is almost ever needed. > Do we always have to remove the whole parent directory and all its > contents together? For 99% of all debugfs usages, yes, that is true. If you really do need the file dentry, there is still a call to create it, and you can always query debugfs for the dentry after it is created if you need it later on. thanks, greg k-h