Re: [PATCH][next] blktrace: remove redundant assignment to ret

From: Jens Axboe
Date: Tue Jun 04 2019 - 11:47:28 EST

On 6/4/19 8:27 AM, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> Variable ret is being assigned a value that is never read, hence
> the assignment is redundant and can be removed.

This doesn't look correct to me, here's the full code:

ret = -ENOENT;

dir = debugfs_lookup(buts->name, blk_debugfs_root);
if (!dir)
bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root);
if (!dir)
goto err;
return ret;

The main issue here, to me, looks like we're not dealing with ERR_PTR
returns from debugfs_create_dir(), just checking for NULL.

Jens Axboe