Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2638508yba; Mon, 15 Apr 2019 16:30:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6tVtGKVRUtUtgU/CGVOEkLYm77Fqk7kiSAz3hyY1CJ9ZIBPp3+6JKErD6C1TjX7881v+L X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr80051916pls.40.1555371050674; Mon, 15 Apr 2019 16:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555371050; cv=none; d=google.com; s=arc-20160816; b=uZTMMHj3UaxHrd09itLt7UMopgZZMoL7e/V5Kibn3t6m9dNkR73uwcYoYQF8WuFV6L HYlt/2BDMmui37hUil4us+s/+D3nSi/Md97kY5Qe+e3pDSXHICvm6MhrJq2iGLXibpQP XVI3Lp5hevqf6T3Z1QvyGD3HlsfTGzMXzAZPbk8Y0D+s5EBncm+3MK62Gpwb4S1V9KxS GecCw/BbFq3rr6VkkLpO7P9s0W4O7Fo8YJ3L+kKkJ/0GlYs8S+QOCke6yIDhjKnWRP8t 809rOI/PI2NmSTpRf0scWyNZ0Kvx9dqHCTVJXuyLTuPCiHgdSTP7e1lb0vtzXvGrUxTr vCgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:dkim-filter :date; bh=BuOtkrMAUYu1+1/8igGzKOVKPb+zN93+5YcXAGnGH+g=; b=0pQM097WjgtKZF0MuH7qoF/EeQ20qMiSf8FlBYbskD5fshd6ex5xkkLK3LswUOs+w9 5BeTOBipZJZZ6lM5SoJZEfux/qxaQ5Qq7pfk5BFwnXUyor2lLXrbUjkwLtO4Dhs9NWbb d0ecdEMgELYgre2WwRa3G+OzBzBi/u9JbQW58T7e0rM4/exJCYi9PtjHHRhM3H4B8I8G rXWtxcRdgga5Ncil3a0VVqmgMQYg81tYB9x3qAQH+IpsYA/8QUERW/vYP+zSvLhP3DHc roeGP/3AzZgJnQYAHVFXaHphju/pRpiDjayKOjy3l2Baa3Rs0YWBUCezzfay9WNaiSwO X2Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=HGElDRzv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 74si45127075pgb.203.2019.04.15.16.30.34; Mon, 15 Apr 2019 16:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=HGElDRzv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfDOX37 (ORCPT + 99 others); Mon, 15 Apr 2019 19:29:59 -0400 Received: from chill.innovation.ch ([216.218.245.220]:58492 "EHLO chill.innovation.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbfDOX37 (ORCPT ); Mon, 15 Apr 2019 19:29:59 -0400 Date: Mon, 15 Apr 2019 16:29:59 -0700 DKIM-Filter: OpenDKIM Filter v2.10.3 chill.innovation.ch 1AC19640135 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=innovation.ch; s=default; t=1555370999; bh=BuOtkrMAUYu1+1/8igGzKOVKPb+zN93+5YcXAGnGH+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HGElDRzvO4rb9HcycAwYiJPt6LLYA7DG2VNGKGt3dnx+ezzIyRtdjAzjOKzURsAlG KvD5QSyxAsIJ5OP10gqbnHaEsL4QrzzxnCO1E6Ue/sDkvMrTgHJGQv/dUXVyQMYwLM aUKscrCWpzrY55KhgexQROUopL3hSSZjfZhCeURsE3t8oiXi6NFWf549Un3tL4GSKZ D2YT5iTxIdpllj7yjTHtePODGg+OCY361M5PfeXBBWScxyMfK7bPfmYYNpvdta/Noh h7w7MOpmBXaQFqXDM6/fAcmVXjXQOnw4bNUaeYuxi+PfKYDHy+Ayfofxq9rK8bspEU zsQFJ3sScUY3Q== From: "Life is hard, and then you die" To: Greg Kroah-Hartman Cc: Jonathan Corbet , "Rafael J. Wysocki" , Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] debugfs: make return value of all debugfs helpers consistent Message-ID: <20190415232959.GC13033@innovation.ch> References: <20190415082506.25610-1-ronald@innovation.ch> <20190415082506.25610-3-ronald@innovation.ch> <20190415084844.GA26101@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190415084844.GA26101@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Mon, Apr 15, 2019 at 10:48:44AM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 15, 2019 at 01:25:06AM -0700, Ronald Tschal?r wrote: > > Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") > > almost all the debugfs helpers have stopped returning NULL. The lone > > holdeout was debugfs_create_u32_array(). So fix that. > > > > Signed-off-by: Ronald Tschal?r > > --- > > fs/debugfs/file.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c > > index ddd708b09fa1..bb706d073782 100644 > > --- a/fs/debugfs/file.c > > +++ b/fs/debugfs/file.c > > @@ -999,8 +999,8 @@ static const struct file_operations u32_array_fops = { > > * Once array is created its size can not be changed. > > * > > * The function returns a pointer to dentry on success. If an error occurs, > > - * %ERR_PTR(-ERROR) or NULL will be returned. If debugfs is not enabled in > > - * the kernel, the value %ERR_PTR(-ENODEV) will be returned. > > + * %ERR_PTR(-ERROR) will be returned. If debugfs is not enabled in the kernel, > > + * the value %ERR_PTR(-ENODEV) will be returned. > > */ > > struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, > > struct dentry *parent, > > @@ -1009,7 +1009,7 @@ struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, > > struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL); > > > > if (data == NULL) > > - return NULL; > > + return ERR_PTR(-ENOMEM); > > > > data->array = array; > > data->elements = elements; > > There is only one caller of this function in the kernel now, and it does > not even care about the return value at all, so we should just remove > the return value entirely as that's the easiest and best thing to do > here. Interesting argument: since this is a helper/library function, and therefore potentially used in the future by others, it seems to me that consistency with the other functions and providing error feedback would be important. > I was going to start doing this slowly over time, but as you are > touching the function now, might as well do it here :) Are you saying the plan is to make all these helpers return void? Cheers, Ronald