diff options
author | Tom Rix <trix@redhat.com> | 2020-06-08 05:54:46 -0700 |
---|---|---|
committer | Moritz Fischer <mdf@kernel.org> | 2020-06-18 18:25:42 -0700 |
commit | d3fbd739fc8a3cf9418c4a17ba7b2b5be24a3b2c (patch) | |
tree | a60d6d25c263ca21c3b79a86d4317b8cdb5945dd /drivers/fpga | |
parent | 88aaab9218f87c7c32e5db93554cf110352c3c13 (diff) | |
download | linux-d3fbd739fc8a3cf9418c4a17ba7b2b5be24a3b2c.tar.gz linux-d3fbd739fc8a3cf9418c4a17ba7b2b5be24a3b2c.tar.bz2 linux-d3fbd739fc8a3cf9418c4a17ba7b2b5be24a3b2c.zip |
fpga: Fix dead store in fpga-bridge.c
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 <trix@redhat.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r-- | drivers/fpga/fpga-bridge.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 4bab9028940a..2deccacc3aa7 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -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); |