Skip to content

Commit

Permalink
fpga: fpga-mgr: remove unnecessary code in __fpga_mgr_get
Browse files Browse the repository at this point in the history
Notice that mgr = to_fpga_manager(dev); expands to:

mgr = container_of(dev, struct fpga_manager, dev);

and container_of is never null, so this null check is
unnecessary.

Addresses-Coverity-ID: 1397916
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Gustavo A. R. Silva authored and Greg Kroah-Hartman committed Nov 28, 2017
1 parent 845089b commit 5f76c6f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/fpga/fpga-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ static struct fpga_manager *__fpga_mgr_get(struct device *dev)
struct fpga_manager *mgr;

mgr = to_fpga_manager(dev);
if (!mgr)
goto err_dev;

if (!try_module_get(dev->parent->driver->owner))
goto err_dev;
Expand Down

0 comments on commit 5f76c6f

Please sign in to comment.