[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A20ACC86-F6C9-4C38-8D63-535BB8CC42F9@cisco.com>
Date: Wed, 23 Jan 2019 00:16:53 +0000
From: "Parvi Kaustubhi (pkaustub)" <pkaustub@...co.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Doug Ledford <dledford@...hat.com>, Jason Gunthorpe <jgg@...pe.ca>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"Christian Benvenuti (benve)" <benve@...co.com>,
"Nelson Escobar (neescoba)" <neescoba@...co.com>
Subject: Re: [PATCH 7/8] infiniband: usnic: no need to check return value of
debugfs_create functions
usnic driver was tested with this change.
Acked-by: Parvi Kaustubhi <pkaustub@...co.com>
> On Jan 22, 2019, at 7:17 AM, Greg Kroah-Hartman <gregkh@...uxfoundation.org> 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.
>
> Cc: Christian Benvenuti <benve@...co.com>
> Cc: Nelson Escobar <neescoba@...co.com>
> Cc: Parvi Kaustubhi <pkaustub@...co.com>
> Cc: Doug Ledford <dledford@...hat.com>
> Cc: Jason Gunthorpe <jgg@...pe.ca>
> Cc: linux-rdma@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
> drivers/infiniband/hw/usnic/usnic_debugfs.c | 26 ---------------------
> 1 file changed, 26 deletions(-)
>
> diff --git a/drivers/infiniband/hw/usnic/usnic_debugfs.c b/drivers/infiniband/hw/usnic/usnic_debugfs.c
> index a3115709fb03..e5a3f02fb078 100644
> --- a/drivers/infiniband/hw/usnic/usnic_debugfs.c
> +++ b/drivers/infiniband/hw/usnic/usnic_debugfs.c
> @@ -113,42 +113,21 @@ static const struct file_operations flowinfo_ops = {
> void usnic_debugfs_init(void)
> {
> debugfs_root = debugfs_create_dir(DRV_NAME, NULL);
> - if (IS_ERR(debugfs_root)) {
> - usnic_err("Failed to create debugfs root dir, check if debugfs is enabled in kernel configuration\n");
> - goto out_clear_root;
> - }
>
> flows_dentry = debugfs_create_dir("flows", debugfs_root);
> - if (IS_ERR_OR_NULL(flows_dentry)) {
> - usnic_err("Failed to create debugfs flow dir with err %ld\n",
> - PTR_ERR(flows_dentry));
> - goto out_free_root;
> - }
>
> debugfs_create_file("build-info", S_IRUGO, debugfs_root,
> NULL, &usnic_debugfs_buildinfo_ops);
> - return;
> -
> -out_free_root:
> - debugfs_remove_recursive(debugfs_root);
> -out_clear_root:
> - debugfs_root = NULL;
> }
>
> void usnic_debugfs_exit(void)
> {
> - if (!debugfs_root)
> - return;
> -
> debugfs_remove_recursive(debugfs_root);
> debugfs_root = NULL;
> }
>
> void usnic_debugfs_flow_add(struct usnic_ib_qp_grp_flow *qp_flow)
> {
> - if (IS_ERR_OR_NULL(flows_dentry))
> - return;
> -
> scnprintf(qp_flow->dentry_name, sizeof(qp_flow->dentry_name),
> "%u", qp_flow->flow->flow_id);
> qp_flow->dbgfs_dentry = debugfs_create_file(qp_flow->dentry_name,
> @@ -156,11 +135,6 @@ void usnic_debugfs_flow_add(struct usnic_ib_qp_grp_flow *qp_flow)
> flows_dentry,
> qp_flow,
> &flowinfo_ops);
> - if (IS_ERR_OR_NULL(qp_flow->dbgfs_dentry)) {
> - usnic_err("Failed to create dbg fs entry for flow %u with error %ld\n",
> - qp_flow->flow->flow_id,
> - PTR_ERR(qp_flow->dbgfs_dentry));
> - }
> }
>
> void usnic_debugfs_flow_remove(struct usnic_ib_qp_grp_flow *qp_flow)
> --
> 2.20.1
>
Powered by blists - more mailing lists