DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] staging: wilc1000: remove redundant assignment to variable result
@ 2020-01-14 17:27 Colin King
  2020-01-16 11:08 ` Claudiu.Beznea
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-01-14 17:27 UTC (permalink / raw)
  To: Adham Abozaeid, Ajay Singh, Greg Kroah-Hartman, linux-wireless, devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable result is being initialized with a value that
is never read and is being re-assigned later on. The assignment
is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/wilc1000/spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c
index 55f8757325f0..8694ab5fcb22 100644
--- a/drivers/staging/wilc1000/spi.c
+++ b/drivers/staging/wilc1000/spi.c
@@ -733,7 +733,7 @@ static int spi_internal_read(struct wilc *wilc, u32 adr, u32 *data)
 static int wilc_spi_write_reg(struct wilc *wilc, u32 addr, u32 data)
 {
 	struct spi_device *spi = to_spi_device(wilc->dev);
-	int result = N_OK;
+	int result;
 	u8 cmd = CMD_SINGLE_WRITE;
 	u8 clockless = 0;
 
@@ -782,7 +782,7 @@ static int wilc_spi_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size)
 static int wilc_spi_read_reg(struct wilc *wilc, u32 addr, u32 *data)
 {
 	struct spi_device *spi = to_spi_device(wilc->dev);
-	int result = N_OK;
+	int result;
 	u8 cmd = CMD_SINGLE_READ;
 	u8 clockless = 0;
 
-- 
2.24.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] staging: wilc1000: remove redundant assignment to variable result
  2020-01-14 17:27 [PATCH][next] staging: wilc1000: remove redundant assignment to variable result Colin King
@ 2020-01-16 11:08 ` Claudiu.Beznea
  0 siblings, 0 replies; 2+ messages in thread
From: Claudiu.Beznea @ 2020-01-16 11:08 UTC (permalink / raw)
  To: colin.king, Adham.Abozaeid, Ajay.Kathat, gregkh, linux-wireless, devel
  Cc: kernel-janitors, linux-kernel



On 14.01.2020 19:27, Colin King wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable result is being initialized with a value that
> is never read and is being re-assigned later on. The assignment
> is redundant and hence can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

> ---
>  drivers/staging/wilc1000/spi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c
> index 55f8757325f0..8694ab5fcb22 100644
> --- a/drivers/staging/wilc1000/spi.c
> +++ b/drivers/staging/wilc1000/spi.c
> @@ -733,7 +733,7 @@ static int spi_internal_read(struct wilc *wilc, u32 adr, u32 *data)
>  static int wilc_spi_write_reg(struct wilc *wilc, u32 addr, u32 data)
>  {
>         struct spi_device *spi = to_spi_device(wilc->dev);
> -       int result = N_OK;
> +       int result;
>         u8 cmd = CMD_SINGLE_WRITE;
>         u8 clockless = 0;
> 
> @@ -782,7 +782,7 @@ static int wilc_spi_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size)
>  static int wilc_spi_read_reg(struct wilc *wilc, u32 addr, u32 *data)
>  {
>         struct spi_device *spi = to_spi_device(wilc->dev);
> -       int result = N_OK;
> +       int result;
>         u8 cmd = CMD_SINGLE_READ;
>         u8 clockless = 0;
> 
> --
> 2.24.0
> 
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 17:27 [PATCH][next] staging: wilc1000: remove redundant assignment to variable result Colin King
2020-01-16 11:08 ` Claudiu.Beznea

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git