2023-07-13 07:41:00

by Wang Ming

[permalink] [raw]
Subject: [PATCH v1] scsi: qla2xxx: Remove error checking for debugfs_create_dir()

It is expected that most callers should _ignore_ the errors
return by debugfs_create_dir() in qla2x00_dfs_create_rport()
and qla2x00_dfs_setup().

Signed-off-by: Wang Ming <[email protected]>
---
drivers/scsi/qla2xxx/qla_dfs.c | 12 ------------
1 file changed, 12 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
index 1925cc6897b6..8cd67092aff4 100644
--- a/drivers/scsi/qla2xxx/qla_dfs.c
+++ b/drivers/scsi/qla2xxx/qla_dfs.c
@@ -111,13 +111,8 @@ qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
debugfs_create_file(#_attr, 0400, fp->dfs_rport_dir, \
fp, &qla_dfs_rport_field_##_attr##_fops)

- if (!vha->dfs_rport_root || fp->dfs_rport_dir)
- return;
-
sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
- if (!fp->dfs_rport_dir)
- return;
if (NVME_TARGET(vha->hw, fp))
debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,
fp, &qla_dfs_rport_dev_loss_tmo_fops);
@@ -139,8 +134,6 @@ qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
void
qla2x00_dfs_remove_rport(scsi_qla_host_t *vha, struct fc_port *fp)
{
- if (!vha->dfs_rport_root || !fp->dfs_rport_dir)
- return;
debugfs_remove_recursive(fp->dfs_rport_dir);
fp->dfs_rport_dir = NULL;
}
@@ -705,11 +698,6 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
}
}
vha->dfs_rport_root = debugfs_create_dir("rports", ha->dfs_dir);
- if (!vha->dfs_rport_root) {
- ql_log(ql_log_warn, vha, 0xd012,
- "Unable to create debugFS rports node.\n");
- goto out;
- }
out:
return 0;
}
--
2.25.1