diff mbox series

[net-next] ieee802154: remove set but not used variable 'status'

Message ID 20191023070618.30044-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Headers show
Series [net-next] ieee802154: remove set but not used variable 'status' | expand

Commit Message

Yue Haibing Oct. 23, 2019, 7:06 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ieee802154/cc2520.c:221:5: warning:
 variable status set but not used [-Wunused-but-set-variable]

It is never used, so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ieee802154/cc2520.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

David Miller Oct. 24, 2019, 10:19 p.m. UTC | #1
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 23 Oct 2019 15:06:18 +0800

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ieee802154/cc2520.c:221:5: warning:
>  variable status set but not used [-Wunused-but-set-variable]
> 
> It is never used, so can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

I am assuming the WPAN folks will pick this up, thanks.
Stefan Schmidt Oct. 25, 2019, 4:37 a.m. UTC | #2
Hello.

On 23.10.19 09:06, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ieee802154/cc2520.c:221:5: warning:
>   variable status set but not used [-Wunused-but-set-variable]
> 
> It is never used, so can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   drivers/net/ieee802154/cc2520.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
> index 4350694..89c046b 100644
> --- a/drivers/net/ieee802154/cc2520.c
> +++ b/drivers/net/ieee802154/cc2520.c
> @@ -218,7 +218,6 @@ static int
>   cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd)
>   {
>   	int ret;
> -	u8 status = 0xff;
>   	struct spi_message msg;
>   	struct spi_transfer xfer = {
>   		.len = 0,
> @@ -236,8 +235,6 @@ cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd)
>   		 priv->buf[0]);
>   
>   	ret = spi_sync(priv->spi, &msg);
> -	if (!ret)
> -		status = priv->buf[0];
>   	dev_vdbg(&priv->spi->dev,
>   		 "buf[0] = %02x\n", priv->buf[0]);
>   	mutex_unlock(&priv->buffer_mutex);
> 

Applied to wpan-next. Thanks!

regards
Stefan Schmidt
Stefan Schmidt Oct. 25, 2019, 4:38 a.m. UTC | #3
Hello.

On 25.10.19 00:19, David Miller wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> Date: Wed, 23 Oct 2019 15:06:18 +0800
> 
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/net/ieee802154/cc2520.c:221:5: warning:
>>   variable status set but not used [-Wunused-but-set-variable]
>>
>> It is never used, so can be removed.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> I am assuming the WPAN folks will pick this up, thanks.

Correct. I was waiting for an ACK from the driver maintainer. Its simple 
enough to not need any further waiting though, applied now.

regards
Stefan Schmidt
diff mbox series

Patch

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index 4350694..89c046b 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -218,7 +218,6 @@  static int
 cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd)
 {
 	int ret;
-	u8 status = 0xff;
 	struct spi_message msg;
 	struct spi_transfer xfer = {
 		.len = 0,
@@ -236,8 +235,6 @@  cc2520_cmd_strobe(struct cc2520_private *priv, u8 cmd)
 		 priv->buf[0]);
 
 	ret = spi_sync(priv->spi, &msg);
-	if (!ret)
-		status = priv->buf[0];
 	dev_vdbg(&priv->spi->dev,
 		 "buf[0] = %02x\n", priv->buf[0]);
 	mutex_unlock(&priv->buffer_mutex);