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=-3.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT 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 19300C282C0 for ; Wed, 23 Jan 2019 10:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5CFD20861 for ; Wed, 23 Jan 2019 10:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548239607; bh=05+QP1/IfQ2zRlaE7VFC5Anef3OSNP6s+MWJlx9QijY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=o/JIE7oEmz8uA2YWRI9EU+0tvhdKj3YXT3OdsXw8JOODzjexIRos3jsFx8I2dmk0s 4fNuDUuZb0Bd/n8TbCwmMoXfIPPriKW7CB5jpD7n0W3EPj+uTQAgSCNbAu/ZrnbJcj pZ7EMbNu0pewfX497p97eHPivYRw0bPPAWIjGOGo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbfAWKd0 (ORCPT ); Wed, 23 Jan 2019 05:33:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:33486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfAWKdZ (ORCPT ); Wed, 23 Jan 2019 05:33:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9306A20861; Wed, 23 Jan 2019 10:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548239605; bh=05+QP1/IfQ2zRlaE7VFC5Anef3OSNP6s+MWJlx9QijY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d+/r6hCFgyjA5y4JkhGPoB/dDKBm9mGMdJ9IQY6RE/nS+FcvchIO0tZVd4laf00Zo Uhx6MTduw8eUp2mMZ6AyPBfCbzhU/M6qQ9YsZoqt8Z4JclfuNG9FP6bRrDl17bOt43 NefUwwIv6i8BkuSu7YLjd/eJBVCR8AtT/ZRp58Yo= Date: Wed, 23 Jan 2019 11:33:21 +0100 From: Greg Kroah-Hartman To: Ulf Hansson Cc: Linux Kernel Mailing List , "Rafael J. Wysocki" , Kevin Hilman , Len Brown , Linux PM Subject: Re: [PATCH] power: domain: no need to check return value of debugfs_create functions Message-ID: <20190123103321.GA17640@kroah.com> References: <20190122152151.16139-6-gregkh@linuxfoundation.org> <20190123075956.GA7597@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 23, 2019 at 09:20:05AM +0100, Ulf Hansson wrote: > On Wed, 23 Jan 2019 at 08:59, Greg Kroah-Hartman > wrote: > > > > On Wed, Jan 23, 2019 at 08:44:36AM +0100, Ulf Hansson wrote: > > > On Tue, 22 Jan 2019 at 16:23, Greg Kroah-Hartman > > > wrote: > > > > > > > > When calling debugfs functions, there is no need to ever check the > > > > return value. The function can work or not, but the code logic should > > > > never do something different based on this. > > > > > > Doesn't this boils done to whether we want to care to check if memory > > > allocation failed? > > > > You should not care. > > Okay. > > > > > > Somewhere down the call chain from debugfs_create_dir(), we end up in > > > alloc_inode() and it looks like that can fail, no? > > > > Yes it can, right now it will return NULL, I'll go change that to return > > ENOMEM, but even then, your really do not care what happens as none of > > your other code flow should ever care about what debugfs does, or does > > not, do. > > In that case, why don't we convert the debugfs_create_dir() and > friends, to becomes "void" functions? Or maybe that's your plan going > forward? I can't, as sometimes you actually care about using the return value in another debugfs call. thanks, greg k-h