s390/zcore: no need to check return value of debugfs_create functions
authorAlexander Egorenkov <egorenar@linux.ibm.com>
Fri, 26 Feb 2021 10:21:05 +0000 (11:21 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 8 Mar 2021 09:46:28 +0000 (10:46 +0100)
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.

See commit 7dd541a3fb34 ("s390: no need to check return value of debugfs_create functions").

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/char/zcore.c

index 1515fdc..1bf507c 100644 (file)
@@ -293,28 +293,12 @@ static int __init zcore_init(void)
                goto fail;
 
        zcore_dir = debugfs_create_dir("zcore" , NULL);
-       if (!zcore_dir) {
-               rc = -ENOMEM;
-               goto fail;
-       }
        zcore_reipl_file = debugfs_create_file("reipl", S_IRUSR, zcore_dir,
                                                NULL, &zcore_reipl_fops);
-       if (!zcore_reipl_file) {
-               rc = -ENOMEM;
-               goto fail_dir;
-       }
        zcore_hsa_file = debugfs_create_file("hsa", S_IRUSR|S_IWUSR, zcore_dir,
                                             NULL, &zcore_hsa_fops);
-       if (!zcore_hsa_file) {
-               rc = -ENOMEM;
-               goto fail_reipl_file;
-       }
-       return 0;
 
-fail_reipl_file:
-       debugfs_remove(zcore_reipl_file);
-fail_dir:
-       debugfs_remove(zcore_dir);
+       return 0;
 fail:
        diag308(DIAG308_REL_HSA, NULL);
        return rc;