Skip to content

Commit

Permalink
fpga: Fix dead store in fpga-bridge.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Rix authored and Moritz Fischer committed Jun 19, 2020
1 parent 88aaab9 commit d3fbd73
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/fpga/fpga-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
Expand Down

0 comments on commit d3fbd73

Please sign in to comment.