提交 5f76c6f3 编写于 作者: G Gustavo A. R. Silva 提交者: Greg Kroah-Hartman

fpga: fpga-mgr: remove unnecessary code in __fpga_mgr_get

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: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NAlan Tull <atull@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 845089bb
...@@ -412,8 +412,6 @@ static struct fpga_manager *__fpga_mgr_get(struct device *dev) ...@@ -412,8 +412,6 @@ static struct fpga_manager *__fpga_mgr_get(struct device *dev)
struct fpga_manager *mgr; struct fpga_manager *mgr;
mgr = to_fpga_manager(dev); mgr = to_fpga_manager(dev);
if (!mgr)
goto err_dev;
if (!try_module_get(dev->parent->driver->owner)) if (!try_module_get(dev->parent->driver->owner))
goto err_dev; goto err_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册