Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5941928ybi; Wed, 12 Jun 2019 11:06:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeV4o74bjjWmtIncPA13VBwXOshGHMXu2JYy+lco9+wN/uaC2GYVjopC63dLimDByjwvEZ X-Received: by 2002:a17:902:29c3:: with SMTP id h61mr48055299plb.37.1560362762231; Wed, 12 Jun 2019 11:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362762; cv=none; d=google.com; s=arc-20160816; b=u4PwKBmAllUY1u+nAspbRE1EgrRHeAOVVFKmBPSxAPX+4LM6G8177oSVbBWiCSTCfA oP5hAYCfG8b9f3f+ImsbCTh7rszEDcfNPhns7/Oes+QA3JIw7VvQQpGxv/n6T4DIBo3a 6BW5/UyjQqtAcucnEJ+1ckADUg7nOp//9w6HVORIU7tDvEXAtiTnDZAm97jIAX5TQ8ls kAJaxAnDxuMxfAyhq98/AbfMpxVjAUAtLkRsPUUakkrrbDVeAXGuqHogf2XJ+fSrL49H SBInmM4oQvcEYoNAcJ4CbiI5hoyXn39hqqX0U1Mu4A01WlrCs+m1PS+Br9pEyZFPN1Qp eqFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=IwW8vRdcQ21gIAzodEXv62PYAidwbeEhr3KWtlFegIs=; b=RqaBd27EexRrT+im4YZptTQugkWUwy8cnmEauBhPI0rqnAvZ7WBueqvOH0LDOxq5tm xOYBNSEE0fqhT2g1UkS+GwRwxDPiRfnoG3a5QkyKTsgd6kCQ5f1HqRpsXE0fueE4UiG4 k4ZNtIeOghzmYVZIA2o1NCH0OcDLHeYmimrhncDChhBCysCkBT6lM4Vqi7y79D36Eab+ 1WqH3RWkRmj9Qv15YVu439t1eGh85nEah4wHaa/cQ4nn9yw9VkAJjwMB0f8OItcQn1Hs X0fGpb1IL+zNMw2crQvi7ZM9ZG49dsilSw/VbCh1sOG74h4SnUgWMVIcKkdiuNet98lv jSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aEQNoMNN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si382554pgp.438.2019.06.12.11.05.47; Wed, 12 Jun 2019 11:06:02 -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=@kernel.org header.s=default header.b=aEQNoMNN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409412AbfFLPfQ (ORCPT + 99 others); Wed, 12 Jun 2019 11:35:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:42788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409404AbfFLPfQ (ORCPT ); Wed, 12 Jun 2019 11:35:16 -0400 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 0CFD8215EA; Wed, 12 Jun 2019 15:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560353715; bh=MBmMqwaKq7lLowYzqNPWrTYCHId7s+yQGyoFIryVQRU=; h=Date:From:To:Cc:Subject:From; b=aEQNoMNNfwaugXOvI+uPAxPoc0cde2LjmZBSzwj4wN4Q0iw5eGz4ScL98T1Npu5tl uh4n5Yerlodca0LH+0fGXte5ECb5JQswpr0NBWVnityCGp0mXQgK2aa9RBDys78S8s nXqtUBz10JftxZYqS7+Ri2jk0sNseNYbNofhtGZw= Date: Wed, 12 Jun 2019 17:35:13 +0200 From: Greg Kroah-Hartman To: Qian Cai , Thomas Gleixner , Andrew Morton , Waiman Long , "Joel Fernandes (Google)" , Zhong Jiang Cc: linux-kernel@vger.kernel.org Subject: [PATCH] lib: debugobjects: no need to check return value of debugfs_create functions Message-ID: <20190612153513.GA21082@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cc: Qian Cai Cc: Thomas Gleixner Cc: Andrew Morton Cc: Waiman Long Cc: "Joel Fernandes (Google)" Cc: Zhong Jiang Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- lib/debugobjects.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 55437fd5128b..2ac42286cd08 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -850,26 +850,16 @@ static const struct file_operations debug_stats_fops = { static int __init debug_objects_init_debugfs(void) { - struct dentry *dbgdir, *dbgstats; + struct dentry *dbgdir; if (!debug_objects_enabled) return 0; dbgdir = debugfs_create_dir("debug_objects", NULL); - if (!dbgdir) - return -ENOMEM; - dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL, - &debug_stats_fops); - if (!dbgstats) - goto err; + debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops); return 0; - -err: - debugfs_remove(dbgdir); - - return -ENOMEM; } __initcall(debug_objects_init_debugfs); -- 2.22.0