fpga: fpga-mgr: remove unnecessary code in __fpga_mgr_get
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Wed, 15 Nov 2017 22:33:10 +0000 (16:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:31:27 +0000 (16:31 +0100)
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>
drivers/fpga/fpga-mgr.c

index 223f2401939bc7b13601e8a6ec2b03e7866b3ba9..9939d2cbc9a6cbca56d5f3e59ce0e068146919dc 100644 (file)
@@ -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;