fpga: fpga-bridge: remove unnecessary null check in of_fpga_bridge_get
PATCH 1/1 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
--- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-)
drivers/fpga/fpga-bridge.c +0 -2
@@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np, goto err_dev; bridge =to_fpga_bridge (dev); -if (!bridge) - goto err_dev; bridge->info = info;
Signature · 1 line
2.7.4
Quoted 10 lines · Gustavo A. R. Silva
Notice that bridge =
to_fpga_bridge(dev); expands to:bridge =
container_of(dev, struct fpga_bridge, dev);and
container_ofis never null, so this null check is unnecessary.Addresses-Coverity-ID: 1397912
Reported-by Alan Tull <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Quoted 24 lines
--- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-)drivers/fpga/fpga-bridge.c +0
-2@@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np, goto err_dev; bridge =to_fpga_bridge (dev); -if (!bridge) - goto err_dev; bridge->info = info;Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-fpga" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for the fix,
Moritz
Hi Moritz,
Quoting Moritz Fischer <[email protected]>:
Quoted 33 lines · Gustavo A. R. Silva
Quoted 10 lines
Notice that bridge =
to_fpga_bridge(dev); expands to:bridge =
container_of(dev, struct fpga_bridge, dev);and
container_ofis never null, so this null check is unnecessary.Addresses-Coverity-ID: 1397912
Reported-by Alan Tull <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Moritz Fischer <[email protected]>Quoted 21 lines
--- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-)drivers/fpga/fpga-bridge.c +0
-3@@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(structdevice_node *np, goto err_dev; bridge =to_fpga_bridge (dev); -if (!bridge) - goto err_dev; bridge->info = info; --2.7.4
Quoted 7 lines
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlThanks for the fix,
Glad to help.
Thanks
--
Gustavo A. R. Silva
On Sat, Oct 28, 2017 at 12:15 PM, Moritz Fischer <[email protected]> wrote:
Hi Gustavo,
Thanks!
Alan
Quoted 5 lines · Gustavo A. R. Silva
Quoted 4 lines
Notice that bridge =
to_fpga_bridge(dev); expands to:bridge =
container_of(dev, struct fpga_bridge, dev);
Quoted 7 lines
Quoted 6 lines
and
container_ofis never null, so this null check is unnecessary.Addresses-Coverity-ID: 1397912
Reported-by Alan Tull <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Moritz Fischer <[email protected]>
Quoted 28 lines
Quoted 20 lines
--- drivers/fpga/fpga-bridge.c | 2 -- 1 file changed, 2 deletions(-)drivers/fpga/fpga-bridge.c +0
-3@@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np, goto err_dev; bridge =to_fpga_bridge (dev); -if (!bridge) - goto err_dev; bridge->info = info; --2.7.4
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlThanks for the fix,
Moritz
Hi Alan,
Quoting Alan Tull <[email protected]>:
Quoted 6 lines · Moritz Fischer
Hi Gustavo,
Thanks!
Glad to help. :)
Thanks
--
Gustavo A. R. Silva