All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ieee802154: remove unused variable 'val'
@ 2018-03-01 14:40 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2018-03-01 14:40 UTC (permalink / raw)
  To: Xue Liu, Alexander Aring, Stefan Schmidt, linux-wpan, netdev
  Cc: kernel-janitors, linux-kernel

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

Variable 'val' is not being initialized and is later being logically
or'd with DAR_PHY_CTRL4_PROMISCUOUS. Considering this variable is never
being read anyway we may as well remove val altogether.

Cleans up error detected by cppcheck:
drivers/net/ieee802154/mcr20a.c:732: (error) Uninitialized variable: val

Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ieee802154/mcr20a.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
index d9eb22a52551..55a22c761808 100644
--- a/drivers/net/ieee802154/mcr20a.c
+++ b/drivers/net/ieee802154/mcr20a.c
@@ -723,13 +723,11 @@ mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
 	struct mcr20a_local *lp = hw->priv;
 	int ret;
 	u8 rx_frame_filter_reg = 0x0;
-	u8 val;
 
 	dev_dbg(printdev(lp), "%s(%d)\n", __func__, on);
 
 	if (on) {
 		/* All frame types accepted*/
-		val |= DAR_PHY_CTRL4_PROMISCUOUS;
 		rx_frame_filter_reg &= ~(IAR_RX_FRAME_FLT_FRM_VER);
 		rx_frame_filter_reg |= (IAR_RX_FRAME_FLT_ACK_FT |
 				  IAR_RX_FRAME_FLT_NS_FT);
-- 
2.15.1

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

* [PATCH][next] ieee802154: remove unused variable 'val'
@ 2018-03-01 14:40 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2018-03-01 14:40 UTC (permalink / raw)
  To: Xue Liu, Alexander Aring, Stefan Schmidt, linux-wpan, netdev
  Cc: kernel-janitors, linux-kernel

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

Variable 'val' is not being initialized and is later being logically
or'd with DAR_PHY_CTRL4_PROMISCUOUS. Considering this variable is never
being read anyway we may as well remove val altogether.

Cleans up error detected by cppcheck:
drivers/net/ieee802154/mcr20a.c:732: (error) Uninitialized variable: val

Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ieee802154/mcr20a.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
index d9eb22a52551..55a22c761808 100644
--- a/drivers/net/ieee802154/mcr20a.c
+++ b/drivers/net/ieee802154/mcr20a.c
@@ -723,13 +723,11 @@ mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
 	struct mcr20a_local *lp = hw->priv;
 	int ret;
 	u8 rx_frame_filter_reg = 0x0;
-	u8 val;
 
 	dev_dbg(printdev(lp), "%s(%d)\n", __func__, on);
 
 	if (on) {
 		/* All frame types accepted*/
-		val |= DAR_PHY_CTRL4_PROMISCUOUS;
 		rx_frame_filter_reg &= ~(IAR_RX_FRAME_FLT_FRM_VER);
 		rx_frame_filter_reg |= (IAR_RX_FRAME_FLT_ACK_FT |
 				  IAR_RX_FRAME_FLT_NS_FT);
-- 
2.15.1


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

* Re: [PATCH][next] ieee802154: remove unused variable 'val'
  2018-03-01 14:40 ` Colin King
@ 2018-03-02 10:41   ` Stefan Schmidt
  -1 siblings, 0 replies; 4+ messages in thread
From: Stefan Schmidt @ 2018-03-02 10:41 UTC (permalink / raw)
  To: Colin King, Xue Liu, Alexander Aring, linux-wpan, netdev
  Cc: kernel-janitors, linux-kernel

Hello.


On 03/01/2018 03:40 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable 'val' is not being initialized and is later being logically
> or'd with DAR_PHY_CTRL4_PROMISCUOUS. Considering this variable is never
> being read anyway we may as well remove val altogether.
>
> Cleans up error detected by cppcheck:
> drivers/net/ieee802154/mcr20a.c:732: (error) Uninitialized variable: val
>
> Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ieee802154/mcr20a.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
> index d9eb22a52551..55a22c761808 100644
> --- a/drivers/net/ieee802154/mcr20a.c
> +++ b/drivers/net/ieee802154/mcr20a.c
> @@ -723,13 +723,11 @@ mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
>  	struct mcr20a_local *lp = hw->priv;
>  	int ret;
>  	u8 rx_frame_filter_reg = 0x0;
> -	u8 val;
>  
>  	dev_dbg(printdev(lp), "%s(%d)\n", __func__, on);
>  
>  	if (on) {
>  		/* All frame types accepted*/
> -		val |= DAR_PHY_CTRL4_PROMISCUOUS;
>  		rx_frame_filter_reg &= ~(IAR_RX_FRAME_FLT_FRM_VER);
>  		rx_frame_filter_reg |= (IAR_RX_FRAME_FLT_ACK_FT |
>  				  IAR_RX_FRAME_FLT_NS_FT);

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH][next] ieee802154: remove unused variable 'val'
@ 2018-03-02 10:41   ` Stefan Schmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Schmidt @ 2018-03-02 10:41 UTC (permalink / raw)
  To: Colin King, Xue Liu, Alexander Aring, linux-wpan, netdev
  Cc: kernel-janitors, linux-kernel

Hello.


On 03/01/2018 03:40 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable 'val' is not being initialized and is later being logically
> or'd with DAR_PHY_CTRL4_PROMISCUOUS. Considering this variable is never
> being read anyway we may as well remove val altogether.
>
> Cleans up error detected by cppcheck:
> drivers/net/ieee802154/mcr20a.c:732: (error) Uninitialized variable: val
>
> Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ieee802154/mcr20a.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
> index d9eb22a52551..55a22c761808 100644
> --- a/drivers/net/ieee802154/mcr20a.c
> +++ b/drivers/net/ieee802154/mcr20a.c
> @@ -723,13 +723,11 @@ mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
>  	struct mcr20a_local *lp = hw->priv;
>  	int ret;
>  	u8 rx_frame_filter_reg = 0x0;
> -	u8 val;
>  
>  	dev_dbg(printdev(lp), "%s(%d)\n", __func__, on);
>  
>  	if (on) {
>  		/* All frame types accepted*/
> -		val |= DAR_PHY_CTRL4_PROMISCUOUS;
>  		rx_frame_filter_reg &= ~(IAR_RX_FRAME_FLT_FRM_VER);
>  		rx_frame_filter_reg |= (IAR_RX_FRAME_FLT_ACK_FT |
>  				  IAR_RX_FRAME_FLT_NS_FT);

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

end of thread, other threads:[~2018-03-02 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 14:40 [PATCH][next] ieee802154: remove unused variable 'val' Colin King
2018-03-01 14:40 ` Colin King
2018-03-02 10:41 ` Stefan Schmidt
2018-03-02 10:41   ` Stefan Schmidt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.