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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 53CA5C31E46 for ; Wed, 12 Jun 2019 15:56:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9855621019 for ; Wed, 12 Jun 2019 15:56:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="E0A2cXDQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9855621019 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45PBLt0qTczDr5y for ; Thu, 13 Jun 2019 01:56:38 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linuxfoundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="E0A2cXDQ"; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45PBJ73PlmzDqnn for ; Thu, 13 Jun 2019 01:54:15 +1000 (AEST) Received: from localhost (83-86-89-107.cable.dynamic.v4.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 A24BD21019; Wed, 12 Jun 2019 15:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560354852; bh=menpCBZD9aZUCarfRE2kMrzLz6afnT/Z2OnvYhmJ+z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E0A2cXDQeSax9afjc6Lw0sqX2o7/Mf6QccsptbwGMawXgvewp3+hxCCehlFOZcg/E /0N/4r6jgzENlAVOSJJCaaWxupvr53eVNpeUGu5syCvAdERUgIJe4l39ipF45RfkfU 1Xl7I+Q6IvXbwtOe0q1/yTaarandYmBHltVgocjA= Date: Wed, 12 Jun 2019 17:54:09 +0200 From: Greg Kroah-Hartman To: Arnd Bergmann Subject: Re: [PATCH] cxl: no need to check return value of debugfs_create functions Message-ID: <20190612155409.GA26564@kroah.com> References: <20190611181309.GA17098@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frederic Barrat , linuxppc-dev , Andrew Donnellan Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jun 12, 2019 at 11:51:21AM +0200, Arnd Bergmann wrote: > On Tue, Jun 11, 2019 at 8:13 PM Greg Kroah-Hartman > wrote: > > > @@ -64,8 +64,6 @@ int cxl_debugfs_adapter_add(struct cxl *adapter) > > > > snprintf(buf, 32, "card%i", adapter->adapter_num); > > dir = debugfs_create_dir(buf, cxl_debugfs); > > - if (IS_ERR(dir)) > > - return PTR_ERR(dir); > > adapter->debugfs = dir; > > > > Should the check for 'cxl_debugfs' get removed here as well? > If that is null, we might put the subdir in the wrong place in the > tree, but that would otherwise be harmless as well, and the > same thing happens if 'dir' is NULL above and we add the > files in the debugfs root later (losing the ability to clean up > afterwards). dir can only be NULL if no one has initialized it, debugfs_create_dir() will never return a null value. I don't really know the ordering of the calls here, so I'll keep this as-is for now incase someone is trying to add a "device" before a directory is initialized. thanks, greg k-h