nfsd: no need to check return value of debugfs_create functions
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: "J. Bruce Fields" <bfields@fieldses.org> Cc: Jeff Layton <jlayton@kernel.org> Cc: linux-nfs@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20190612152603.GB18440@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -127,24 +127,16 @@ static struct nfsd_fault_inject_op inject_ops[] = {
|
||||
},
|
||||
};
|
||||
|
||||
int nfsd_fault_inject_init(void)
|
||||
void nfsd_fault_inject_init(void)
|
||||
{
|
||||
unsigned int i;
|
||||
struct nfsd_fault_inject_op *op;
|
||||
umode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
|
||||
|
||||
debug_dir = debugfs_create_dir("nfsd", NULL);
|
||||
if (!debug_dir)
|
||||
goto fail;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(inject_ops); i++) {
|
||||
op = &inject_ops[i];
|
||||
if (!debugfs_create_file(op->file, mode, debug_dir, op, &fops_nfsd))
|
||||
goto fail;
|
||||
debugfs_create_file(op->file, mode, debug_dir, op, &fops_nfsd);
|
||||
}
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
nfsd_fault_inject_cleanup();
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
Reference in New Issue
Block a user