[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200619013933.GE3685@epycbox.lan>
Date: Thu, 18 Jun 2020 18:39:33 -0700
From: Moritz Fischer <mdf@...nel.org>
To: trix@...hat.com
Cc: mdf@...nel.org, linux-fpga@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] fpga: Fix dead store in fpga-bridge.c
On Mon, Jun 08, 2020 at 05:54:46AM -0700, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> 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@...hat.com>
> ---
> drivers/fpga/fpga-bridge.c | 6 ++----
> 1 file 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);
> --
> 2.18.2
>
Applied to for-next,
Thanks!
Powered by blists - more mailing lists