]> Git Repo - linux.git/commitdiff
fpga: Fix dead store in fpga-bridge.c
authorTom Rix <[email protected]>
Mon, 8 Jun 2020 12:54:46 +0000 (05:54 -0700)
committerMoritz Fischer <[email protected]>
Fri, 19 Jun 2020 01:25:42 +0000 (18:25 -0700)
Using clang's scan-build/view this issue was flagged
a dead store issue in fpga-bridge.c

warning: Value stored to 'ret' is never read [deadcode.DeadStores]
                  ret = id;

Signed-off-by: Tom Rix <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
drivers/fpga/fpga-bridge.c

index 4bab9028940a812cebf6dfbf0ad17785042c4287..2deccacc3aa759ad8dc3761d404a38cceb1034e0 100644 (file)
@@ -328,7 +328,7 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name,
                                       void *priv)
 {
        struct fpga_bridge *bridge;
-       int id, ret = 0;
+       int id, ret;
 
        if (!name || !strlen(name)) {
                dev_err(dev, "Attempt to register with no name!\n");
@@ -340,10 +340,8 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name,
                return NULL;
 
        id = ida_simple_get(&fpga_bridge_ida, 0, 0, GFP_KERNEL);
-       if (id < 0) {
-               ret = id;
+       if (id < 0)
                goto error_kfree;
-       }
 
        mutex_init(&bridge->mutex);
        INIT_LIST_HEAD(&bridge->node);
This page took 0.053549 seconds and 4 git commands to generate.