Skip to content

Commit e0241fb

Browse files
gregkhaxboe
authored andcommitted
block: aoe: 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: "Ed L. Cashin" <ed.cashin@acm.org> Cc: linux-block@vger.kernel.org Cc: Omar Sandoval <osandov@osandov.com> Acked-by: Justin Sanders <justin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ca09720 commit e0241fb

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

‎drivers/block/aoe/aoeblk.c‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ static const struct file_operations aoe_debugfs_fops = {
196196
static void
197197
aoedisk_add_debugfs(struct aoedev *d)
198198
{
199-
struct dentry *entry;
200199
char *p;
201200

202201
if (aoe_debugfs_dir == NULL)
@@ -207,15 +206,8 @@ aoedisk_add_debugfs(struct aoedev *d)
207206
else
208207
p++;
209208
BUG_ON(*p == '\0');
210-
entry = debugfs_create_file(p, 0444, aoe_debugfs_dir, d,
211-
&aoe_debugfs_fops);
212-
if (IS_ERR_OR_NULL(entry)) {
213-
pr_info("aoe: cannot create debugfs file for %s\n",
214-
d->gd->disk_name);
215-
return;
216-
}
217-
BUG_ON(d->debugfs);
218-
d->debugfs = entry;
209+
d->debugfs = debugfs_create_file(p, 0444, aoe_debugfs_dir, d,
210+
&aoe_debugfs_fops);
219211
}
220212
void
221213
aoedisk_rm_debugfs(struct aoedev *d)
@@ -472,10 +464,6 @@ aoeblk_init(void)
472464
if (buf_pool_cache == NULL)
473465
return -ENOMEM;
474466
aoe_debugfs_dir = debugfs_create_dir("aoe", NULL);
475-
if (IS_ERR_OR_NULL(aoe_debugfs_dir)) {
476-
pr_info("aoe: cannot create debugfs directory\n");
477-
aoe_debugfs_dir = NULL;
478-
}
479467
return 0;
480468
}
481469

0 commit comments

Comments
 (0)