Skip to content

Commit 17789f8

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
scsi: fnic: Delete incorrect debugfs error handling
Debugfs functions are not supposed to require error checking and, in fact, adding checks would normally lead to the driver refusing to load when CONFIG_DEBUGFS is disabled. What saves us here is that this code checks for NULL instead of error pointers so the error checking is all dead code. Delete it. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/a5c237cd-449b-4f9d-bcff-6285fb7c28d1@stanley.mountain Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent bab8551 commit 17789f8

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

drivers/scsi/fnic/fnic_debugfs.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -679,46 +679,23 @@ static const struct file_operations fnic_reset_debugfs_fops = {
679679
*/
680680
int fnic_stats_debugfs_init(struct fnic *fnic)
681681
{
682-
int rc = -1;
683682
char name[16];
684683

685684
snprintf(name, sizeof(name), "host%d", fnic->host->host_no);
686685

687-
if (!fnic_stats_debugfs_root) {
688-
pr_debug("fnic_stats root doesn't exist\n");
689-
return rc;
690-
}
691-
692686
fnic->fnic_stats_debugfs_host = debugfs_create_dir(name,
693687
fnic_stats_debugfs_root);
694-
695-
if (!fnic->fnic_stats_debugfs_host) {
696-
pr_debug("Cannot create host directory\n");
697-
return rc;
698-
}
699-
700688
fnic->fnic_stats_debugfs_file = debugfs_create_file("stats",
701689
S_IFREG|S_IRUGO|S_IWUSR,
702690
fnic->fnic_stats_debugfs_host,
703691
fnic,
704692
&fnic_stats_debugfs_fops);
705-
706-
if (!fnic->fnic_stats_debugfs_file) {
707-
pr_debug("Cannot create host stats file\n");
708-
return rc;
709-
}
710-
711693
fnic->fnic_reset_debugfs_file = debugfs_create_file("reset_stats",
712694
S_IFREG|S_IRUGO|S_IWUSR,
713695
fnic->fnic_stats_debugfs_host,
714696
fnic,
715697
&fnic_reset_debugfs_fops);
716-
if (!fnic->fnic_reset_debugfs_file) {
717-
pr_debug("Cannot create host stats file\n");
718-
return rc;
719-
}
720-
rc = 0;
721-
return rc;
698+
return 0;
722699
}
723700

724701
/*

0 commit comments

Comments
 (0)