Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7521150imu; Tue, 22 Jan 2019 07:20:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN5X+/Y8YjVDiHPm87FFDrjBt6/Bh8W+S2CFwnXPS8sqYtlQSBXBbSxI3GHUYxxjnwSEUo2u X-Received: by 2002:a17:902:a03:: with SMTP id 3mr34876636plo.112.1548170415672; Tue, 22 Jan 2019 07:20:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170415; cv=none; d=google.com; s=arc-20160816; b=aTXKHkYdtUqY5NHQXMz1Gh7gBpA+bOjDlmDUjCC0clLyEO04Zmbh2sNClJfEKdC44w G4edAIwxD7OXK2PbYCJRx3ii41Z+wM52oVxfi/aevKIcDwy/L1/Z55fIKtnrVy+w22JT tknpxS+dA9eqmffQimstloHHNEtxZFSI1XhWqtcgWH8Vml91zlDcL8Kq2LXsH9YCspoH fXO5HhUV2+kiKOMCEdU+z+PJKIQRY563Uyav+b6fIA7WyKISXEIPVHsqwndWhS+JcI54 tKux/aO4kXvIK8x7ddZ4n8fVsiqRo+En6n8PFTN1OBE/Kbjrg657YFqnndc4ORaxGkHJ KKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bYFY9b1dc9CaWMntzxUHfz3mrLNe0t+/qtZ8b/eMhIA=; b=nCqSokUjNXc1hv1QleKRf6/3Ad/I00QJKgHx9l1gC9uIwn0au84szKiDhuGqJkVKyz xr93aJ6wL9R8DiIbLnq7bIOm5cXctxduOG65+I8rLAwmYcIBy/1VuNKdyp1l+zl7jlMp Gb19RFEN2JPffP0LQvcTroVxdV0m7XLxWgForuStaMAAo6J5oObq1JIFPmT5she+0xi5 NStf3GOTOCkj8GE8JoI9p+d9ZT28s/VHQOhospv7NfeV5zioE4hzOmloNPIkdjNqdIl8 royS5eJu6ULJjQJHVubUOUzrul5HcVHLzJaInIsE8LsloCvXtVUpzudyDUcJigWo5imx hhbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=km9rqcqt; 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 w1si16286223pgi.66.2019.01.22.07.19.59; Tue, 22 Jan 2019 07:20:15 -0800 (PST) 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=km9rqcqt; 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 S1729361AbfAVPSd (ORCPT + 99 others); Tue, 22 Jan 2019 10:18:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:59414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728958AbfAVPSc (ORCPT ); Tue, 22 Jan 2019 10:18:32 -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 3BC8A20879; Tue, 22 Jan 2019 15:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170311; bh=M0CQKP0oyJa6vxRB0nNgKwJXOPHdBIOeuZsdYA0rNbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=km9rqcqtHURqjn3bOzqrRNZxmCcrfC+ksAITc66Q9STxr+h9Du25ii5imua6hh+7D 50Kcb1fzdq8rkqBCW3xvi/E73JNiZ8JLqmx/WW1XLoaYn+wCUuDYKHQPJUfsfLEkHv ztUxppucheOQ5bgLHj4YcyzItPNJCYKdktsELEoI= From: Greg Kroah-Hartman To: Doug Ledford , Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Greg Kroah-Hartman , Leon Romanovsky , Kamal Heib , Denis Drozdov , Saeed Mahameed , Erez Shitrit , Yuval Shaia , Dennis Dalessandro , Alaa Hleihel , Parav Pandit , Kees Cook , Arseny Maslennikov , Evgenii Smirnov Subject: [PATCH 8/8] infiniband: ipoib: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:18:00 +0100 Message-Id: <20190122151800.15092-9-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122151800.15092-1-gregkh@linuxfoundation.org> References: <20190122151800.15092-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Doug Ledford Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: Kamal Heib Cc: Denis Drozdov Cc: Saeed Mahameed Cc: Erez Shitrit Cc: Yuval Shaia Cc: Dennis Dalessandro Cc: Alaa Hleihel Cc: Parav Pandit Cc: Kees Cook Cc: Arseny Maslennikov Cc: Evgenii Smirnov Cc: linux-rdma@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/ipoib/ipoib.h | 4 ++-- drivers/infiniband/ulp/ipoib/ipoib_fs.c | 7 +------ drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 1da119d901a9..5941d660add1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -781,12 +781,12 @@ static inline void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *w #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG void ipoib_create_debug_files(struct net_device *dev); void ipoib_delete_debug_files(struct net_device *dev); -int ipoib_register_debugfs(void); +void ipoib_register_debugfs(void); void ipoib_unregister_debugfs(void); #else static inline void ipoib_create_debug_files(struct net_device *dev) { } static inline void ipoib_delete_debug_files(struct net_device *dev) { } -static inline int ipoib_register_debugfs(void) { return 0; } +static inline void ipoib_register_debugfs(void) { } static inline void ipoib_unregister_debugfs(void) { } #endif diff --git a/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/drivers/infiniband/ulp/ipoib/ipoib_fs.c index 178488028734..64c19f6fa931 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_fs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_fs.c @@ -267,14 +267,10 @@ void ipoib_create_debug_files(struct net_device *dev) snprintf(name, sizeof(name), "%s_mcg", dev->name); priv->mcg_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, ipoib_root, dev, &ipoib_mcg_fops); - if (!priv->mcg_dentry) - ipoib_warn(priv, "failed to create mcg debug file\n"); snprintf(name, sizeof(name), "%s_path", dev->name); priv->path_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, ipoib_root, dev, &ipoib_path_fops); - if (!priv->path_dentry) - ipoib_warn(priv, "failed to create path debug file\n"); } void ipoib_delete_debug_files(struct net_device *dev) @@ -286,10 +282,9 @@ void ipoib_delete_debug_files(struct net_device *dev) priv->mcg_dentry = priv->path_dentry = NULL; } -int ipoib_register_debugfs(void) +void ipoib_register_debugfs(void) { ipoib_root = debugfs_create_dir("ipoib", NULL); - return ipoib_root ? 0 : -ENOMEM; } void ipoib_unregister_debugfs(void) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index d932f99201d1..45ef3b0f03c5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2577,9 +2577,7 @@ static int __init ipoib_init_module(void) */ BUILD_BUG_ON(IPOIB_CM_COPYBREAK > IPOIB_CM_HEAD_SIZE); - ret = ipoib_register_debugfs(); - if (ret) - return ret; + ipoib_register_debugfs(); /* * We create a global workqueue here that is used for all flush -- 2.20.1