Linux-WPAN Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net-next] ieee802154: remove set but not used variable 'status'
@ 2019-10-23  7:06 YueHaibing
  2019-10-24 22:19 ` David Miller
  2019-10-25  4:37 ` Stefan Schmidt
  0 siblings, 2 replies; 4+ messages in thread
From: YueHaibing @ 2019-10-23  7:06 UTC (permalink / raw)
  To: varkabhadram, alex.aring, stefan, davem
  Cc: linux-wpan, netdev, linux-kernel, YueHaibing

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);
-- 
2.7.4



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

* Re: [PATCH net-next] ieee802154: remove set but not used variable 'status'
  2019-10-23  7:06 [PATCH net-next] ieee802154: remove set but not used variable 'status' YueHaibing
@ 2019-10-24 22:19 ` David Miller
  2019-10-25  4:38   ` Stefan Schmidt
  2019-10-25  4:37 ` Stefan Schmidt
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2019-10-24 22:19 UTC (permalink / raw)
  To: yuehaibing
  Cc: varkabhadram, alex.aring, stefan, linux-wpan, netdev, linux-kernel

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.

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

* Re: [PATCH net-next] ieee802154: remove set but not used variable 'status'
  2019-10-23  7:06 [PATCH net-next] ieee802154: remove set but not used variable 'status' YueHaibing
  2019-10-24 22:19 ` David Miller
@ 2019-10-25  4:37 ` Stefan Schmidt
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Schmidt @ 2019-10-25  4:37 UTC (permalink / raw)
  To: YueHaibing, varkabhadram, alex.aring, davem
  Cc: linux-wpan, netdev, linux-kernel

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

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

* Re: [PATCH net-next] ieee802154: remove set but not used variable 'status'
  2019-10-24 22:19 ` David Miller
@ 2019-10-25  4:38   ` Stefan Schmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Schmidt @ 2019-10-25  4:38 UTC (permalink / raw)
  To: David Miller, yuehaibing
  Cc: varkabhadram, alex.aring, linux-wpan, netdev, linux-kernel

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

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23  7:06 [PATCH net-next] ieee802154: remove set but not used variable 'status' YueHaibing
2019-10-24 22:19 ` David Miller
2019-10-25  4:38   ` Stefan Schmidt
2019-10-25  4:37 ` Stefan Schmidt

Linux-WPAN Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wpan/0 linux-wpan/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 linux-wpan linux-wpan/ https://lore.kernel.org/linux-wpan \
		linux-wpan@vger.kernel.org
	public-inbox-index linux-wpan

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wpan


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