Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1257975pxf; Fri, 26 Mar 2021 04:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHP5yha8aAOSWqC0PKBExm/wo6B/c29GSa6uFSD66aRcy5s2+17CxPaMx50LpiqXg9ZVzd X-Received: by 2002:a17:907:7683:: with SMTP id jv3mr14589372ejc.450.1616758486298; Fri, 26 Mar 2021 04:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616758486; cv=none; d=google.com; s=arc-20160816; b=MKwsFIkwpjEO+az4cZJFk7L1GpioTb8ujFswGR9UIIXc7TXLHt7cXgzC32ZPL72l3x zJcTNXwUgxt0qYppOTfRegZGC+ysSCGqJv8VHZY5N+bRf/BJTvvmmp4BT7ouqwtzml7U cGrTGiFZfOMNA5HYcPmY5enpWRYTsCYfYN6hpjb8YjCa3qeaXzNiBcF/WxPtUOiwYZ+l HyP486jZ8eP00vEcpmdGHD7337zvI3lw6Jvo0zeAU6lTKtMfV3TMAegqCAu7dsG7/N03 MHxiIxqe5Vo/KtYgPqWGuX9ogGw14y0Tc3SpXVuk2O+R+LJ0bPQLS7oBSjzq8EFfRgUU UY2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=xx5y3xULQMyR4iFulCz0UbWRwje2k/OZeYQ+56KX3/Y=; b=o14pOL16xc45pPa8SoRm0mUgV09JyPV9F4ecefuYRwMpOx3Z4qcQYbMW6isuXEjulv /a0pn4tzRElhoztlIILVh7jcYrVPX/r2RtbAwWs6bh4bzYaLFLJUSA3iIX5ifE9i2KPx EJo1e4a3d9275V7NgVooNs1M84YQ23N/2AfeG6s7HCBe1rWfjN+Zfv65pmeHUV/l6TFd gl8AFD+onykNOprQWsDfwgWQrY9iJEVxUgUvNAj4fps9s/o9P3iW1YAKhsOVd8vNOZj8 ExiyO79ebUc+c9yYEOvqlAzYMuqm0rK2vgcgVek1Jw5oTAH1us2VT0kX9JMzjU3kEa1G YAgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm3 header.b="R/szQ5HT"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tegfeFMN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si6472863ejw.372.2021.03.26.04.34.21; Fri, 26 Mar 2021 04:34:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm3 header.b="R/szQ5HT"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tegfeFMN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbhCZLbE (ORCPT + 99 others); Fri, 26 Mar 2021 07:31:04 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:45099 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbhCZLa2 (ORCPT ); Fri, 26 Mar 2021 07:30:28 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 40919580BA3; Fri, 26 Mar 2021 07:30:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 26 Mar 2021 07:30:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=xx5y3xULQMyR4iFulCz0UbWRwje 2k/OZeYQ+56KX3/Y=; b=R/szQ5HTaO3CxZDUnakFVbVhJyRnJC6Opms1GL0fyyM 1XHRHtBPUBMFDd9V5no8Gy07yamxg16N03DZsV26MWDHGd8U8gFsq32O0LDDEkoB CYO+4ZQekNm5y3UsPIlXi0sPtwo4h77GfAeHv0lX86ZZpRmEv+rcctNd+nO+LvnV jNd0SFfcOEqy8oup0jP8+2IJnvW9RcfPhdRC94mgn1YpgOfJ4CaKDOxi7Ok7UhV3 PFGcMYe7NByY3AdQFd8pyzlNIO9Jmc6I2ZzH1SCUyNIyvkbkuBhZJ4XbpFpaNFnt j9aoR9Bgb1xeoXuALwUowomDfQCAsZwkgC+3nQNXaAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=xx5y3x ULQMyR4iFulCz0UbWRwje2k/OZeYQ+56KX3/Y=; b=tegfeFMNdbhU9sE8h3KaIK +6anmX3Kwi5UEamH3eoKT0K2r+23mSK8AnxxRHS84+JAfdILCrluD7F8qN2+SSVo OY5RMnOikVRpCV91PZAz2xDuNrVVI7fwis23I4oRTDTgl98WeKeCGxHq2n62G9Fi kfFh2d5si89LQcTBoHqz9fd5BVTsG8mZAXbGvcwsNGzMeB/xn8z/VsSOMWv5trnD 642xePzwW7TayXCYfYkD8Qs3+YeLLgoPqeRWIbOlYV2HngGd+6WjmHzec1avZ0Na K+fY49kjq/38zOazqj+CYIN13cOXvgi6DnlK0W23E5Qoq2ZMwxdfvqVrLShxjmgA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehvddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeevueehje fgfffgiedvudekvdektdelleelgefhleejieeugeegveeuuddukedvteenucfkphepkeef rdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 97F1924005D; Fri, 26 Mar 2021 07:30:26 -0400 (EDT) Date: Fri, 26 Mar 2021 12:30:24 +0100 From: Greg KH To: Peter Zijlstra Cc: mingo@kernel.org, mgorman@suse.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, joshdon@google.com, valentin.schneider@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/9] debugfs: Implement debugfs_create_str() Message-ID: References: <20210326103352.603456266@infradead.org> <20210326103935.183934395@infradead.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 Fri, Mar 26, 2021 at 12:18:47PM +0100, Peter Zijlstra wrote: > On Fri, Mar 26, 2021 at 12:05:07PM +0100, Greg KH wrote: > > On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > No changelog text? :( > > Yeah, didn't really know what to say that the Subject didn't already do. > > > > +/** > > > + * debugfs_create_str - create a debugfs file that is used to read and write a string value > > > + * @name: a pointer to a string containing the name of the file to create. > > > + * @mode: the permission that the file should have > > > + * @parent: a pointer to the parent dentry for this file. This should be a > > > + * directory dentry if set. If this parameter is %NULL, then the > > > + * file will be created in the root of the debugfs filesystem. > > > + * @value: a pointer to the variable that the file should read to and write > > > + * from. > > > + * > > > + * 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, > > > + * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be > > > + * returned. > > > + * > > > + * NOTE: when writing is enabled it will replace the string, string lifetime is > > > + * assumed to be RCU managed. > > > + * > > > + * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will > > > + * be returned. > > > + */ > > > +struct dentry *debugfs_create_str(const char *name, umode_t mode, > > > + struct dentry *parent, char **value) > > > > Please have this return void, no need for me to have to clean up > > afterward later on :) > > That would make it inconsistent with debugfs_create_{bool,blob}() from > which I copiously 'borrowed'. As mentioned on IRC, I am trying to get rid of the return value, those are the only 2 holdouts given their current use in some of the cruftier areas of the kernel at the moment :( > Also, the return dentry might be useful with debugfs_create_symlink(), > but you're right in that most other create_file wrappers return void. Great, change that and limit the size of the string that can be written and it looks good to me, thanks for adding this. greg k-h