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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 2A775C2B9F8 for ; Tue, 25 May 2021 07:48:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDBD7610CE for ; Tue, 25 May 2021 07:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231875AbhEYHtp (ORCPT ); Tue, 25 May 2021 03:49:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:36438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbhEYHtm (ORCPT ); Tue, 25 May 2021 03:49:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFE486128B; Tue, 25 May 2021 07:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621928893; bh=P+PllHqMuh+hS59i4iVdppeAUj9XXQuHIklVnWcWX94=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0zyZYtFD7ZgbFRIhaW5NyiomeCGZjHh3SKhOPLveqKrAnP4jT03OervbSUj2n4kNT k3qyHG8q6rFPZ8Y9oR1T0ZYGMfV4HfkATmReSzl7M5i4Q1GKbNoVj3bTmoBYnmafyI tIuv6FWCbvIHtz2zacr4Y4zOKW/1mXCBmEW5B/0g= Date: Tue, 25 May 2021 09:48:10 +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 Tue, May 25, 2021 at 09:26:42AM +0200, Geert Uytterhoeven wrote: > Hi Greg, > > On Mon, May 24, 2021 at 2:39 PM Greg Kroah-Hartman > wrote: > > On Mon, May 24, 2021 at 01:44:38PM +0200, Geert Uytterhoeven wrote: > > > On Mon, May 24, 2021 at 12:18 PM Greg Kroah-Hartman > > > wrote: > > > > On Mon, May 24, 2021 at 11:51:42AM +0200, Geert Uytterhoeven wrote: > > > > > On Mon, May 24, 2021 at 11:41 AM Greg Kroah-Hartman > > > > > wrote: > > > > > > On Mon, May 24, 2021 at 11:11:32AM +0200, Geert Uytterhoeven wrote: > > > > > > > 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. > > > > > > > > > > Why do I just not need it? > > > > > > > > Let me flip it around, why do you need it? There are no in-kernel users > > > > of the return value anymore so what code requires this pointer now? > > > > > > There still are a few users of other members in the family, and some > > > of them are meant to be removed without removing the full parent > > > directory. Having all debugfs_create_*() functions behave the same > > > is a bonus. > > > > I agree, and we are almost there, all that is left is: > > debugfs_create_blob() > > debugfs_create_file() > > debugfs_create_file_unsafe() > > for creating debugfs files. > > > > There is still: > > debugfs_create_dir() > > debugfs_create_symlink() > > debugfs_create_automount() > > for non-file creations that do not return void. > > > > The majority of the debugfs_create_* functions now do not return > > anything. > > > > > But if other people are fine with having to call > > > debugfs_remove(debugfs_lookup(...)), well, let it be like that... > > > > It saves at least a static variable, so what's not to like? :) > > Which is more than offset by the cost of the new debugfs_lookup() call... Not when people were keeping a dentry-per-entry in lots of structures. That's from the heap, this dentry pointer sits on the stack, or if we are lucky, only in a register :) thanks, greg k-h