Skip to content

Commit

Permalink
fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gustavo A. R. Silva authored and Greg Kroah-Hartman committed Nov 28, 2017
1 parent 5f76c6f commit 397f33c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/fpga/fpga-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 397f33c

Please sign in to comment.