Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1246967pxf; Fri, 26 Mar 2021 04:20:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+p2WXZVz8yiKqTB9kvlih+QYFWMBoNsL6P2zGjmrY3WPkTpPLGDmGUINksNQmxmuRvdL0 X-Received: by 2002:a05:6402:b2d:: with SMTP id bo13mr14308674edb.120.1616757651282; Fri, 26 Mar 2021 04:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616757651; cv=none; d=google.com; s=arc-20160816; b=unMlIPJ7SHj3gD+hdSIyZ1mmxaTD+cbrZOU6oGwKhZY9r+qz2ajmwba1cuBUu9ryEr c2W/oPVZgNmNtgaJWIVM/3idNI6/mU4Ik3cwEoej+jgaNbvkjuE1aHGMqFkN3jfwTAC2 W3EGduYVYd71lC+OBHF5i0NoVMRm/5zSk3r+whzFPlZyqRR4xE4wOAvS6lodN2GvYeGK +L4r+f1GtgBh2995LpA+iaLSP2qMVfmitnk7MlskDOD7/OEbdQdWnXliDGnlnVjDcmsi bC6DoHyTyaQR7TNYa0KjifYrV32R53VzSDw5bQdcYf3kJf/YWjkSSl6piwzkY7FC9tQs 32XQ== 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; bh=nbfdoB56OSJA++wkCwG7Y5R4eFfXpQtmTwFSIJHLz/c=; b=neg9jizRrykCosCl5omgFfjR4DSlxsA1oZk5AshJYZhpyqUYchvy6Xkj2/uK4OWTwe imufG/egWiNLAyrr37rJNzTEa2GlIW83taPlQhcFX1qZJ3UWDOPP7zZN62P9DKFONZHX vjhp85QhgLqYvqNKupT0J+qVCbuWAEt5FFAo3ibeGQj2LgTu0x7W/M5x0Og/5u6ZwKR1 c51KvNrufRxSN5+0RSr/pXZrCUFAzGa8B8vc5zq+56JX6lqi/Uv6Dn/7ZVJpmKjxpvAi hi3Qti0hSRWKeSvb5ZwCXDiOWBzASLNIva3FQeDX746VdMFNFR3MlSa4bhJiBobE7eag KS9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=G8Fismzw; 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 yd6si6622407ejb.302.2021.03.26.04.20.27; Fri, 26 Mar 2021 04:20:51 -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=@infradead.org header.s=desiato.20200630 header.b=G8Fismzw; 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 S229695AbhCZLTb (ORCPT + 99 others); Fri, 26 Mar 2021 07:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbhCZLTE (ORCPT ); Fri, 26 Mar 2021 07:19:04 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B66C0613AA for ; Fri, 26 Mar 2021 04:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nbfdoB56OSJA++wkCwG7Y5R4eFfXpQtmTwFSIJHLz/c=; b=G8FismzwdvL19CPX/qdZjbZHtY E/9TiTrhEgksF9ea/z3GayckiadJIzULXnkoHdCgpCO+qh2eGH6+1ToX461+RF14w7xEjGs6FRqmF P/wTRoR+wqLYkjL4sEKUbcjPqXuFJsmsP4sjI5QgqpO2PV9dly8mpGKdOAUBhwHvOa7kDMKqsDVR5 wjl873BjVs/Ti8DUf2QyjayHybZvq+/gtlN+RRGw261ZwusU2EH/z81zkMUcCBS8eSfzxjlsYFqNj caTxbZ3ZZ3lwYedsk47yyZvMEI/MaA0NzT5SA2GIDxvnVT4LFfzOJrXmFfk5VojNyOliReKIgnq4t LiTAQgmQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lPkUK-003QTl-15; Fri, 26 Mar 2021 11:18:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A95343003E1; Fri, 26 Mar 2021 12:18:47 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7020A2BCA7ED2; Fri, 26 Mar 2021 12:18:47 +0100 (CET) Date: Fri, 26 Mar 2021 12:18:47 +0100 From: Peter Zijlstra To: Greg KH 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: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'. Also, the return dentry might be useful with debugfs_create_symlink(), but you're right in that most other create_file wrappers return void.