From 397f33cb0a7d60b3d061e70b66baee36a690351a Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Wed, 15 Nov 2017 16:33:11 -0600 Subject: [PATCH] fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get 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 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Moritz Fischer Signed-off-by: Alan Tull Signed-off-by: Greg Kroah-Hartman --- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index e693c3607a14..31bd2c59c305 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -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; -- 2.30.2