fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Wed, 15 Nov 2017 22:33:11 +0000 (16:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:31:27 +0000 (16:31 +0100)
Notice that bridge = to_fpga_bridge(dev); expands to:

bridge = container_of(dev, struct fpga_bridge, dev);

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

Addresses-Coverity-ID: 1397912
Reported-by: Alan Tull <atull@kernel.org>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/fpga-bridge.c

index e693c3607a14941c1c123e5b39e96a913484df1d..31bd2c59c305940fd77bbf81712f50f198743698 100644 (file)
@@ -78,8 +78,6 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
        int ret = -ENODEV;
 
        bridge = to_fpga_bridge(dev);
-       if (!bridge)
-               goto err_dev;
 
        bridge->info = info;