netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iwlwifi: cleanup a mask shift in iwlagn_bt_traffic_is_sco()
@ 2014-10-29 16:08 Dan Carpenter
  2014-10-29 16:16 ` Emmanuel Grumbach
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-10-29 16:08 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Emmanuel Grumbach, Intel Linux Wireless, John W. Linville,
	Paul Gortmaker, Larry Finger, linux-wireless, netdev,
	linux-kernel, kernel-janitors

The shift operation is higher precedence so the code is wrong and it
sets of a static checker warning.  But it doesn't affect real life
because BT_UART_MSG_FRAME3SCOESCO_POS is zero so the shift is a no-op.

I have re-written it in normal style and with parenthesis as a cleanup
and to silence the static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c
index 2191621..065d3d5 100644
--- a/drivers/net/wireless/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/lib.c
@@ -418,7 +418,7 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena)
 
 static bool iwlagn_bt_traffic_is_sco(struct iwl_bt_uart_msg *uart_msg)
 {
-	return BT_UART_MSG_FRAME3SCOESCO_MSK & uart_msg->frame3 >>
+	return (uart_msg->frame3 & BT_UART_MSG_FRAME3SCOESCO_MSK) >>
 			BT_UART_MSG_FRAME3SCOESCO_POS;
 }
 

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

* Re: [patch] iwlwifi: cleanup a mask shift in iwlagn_bt_traffic_is_sco()
  2014-10-29 16:08 [patch] iwlwifi: cleanup a mask shift in iwlagn_bt_traffic_is_sco() Dan Carpenter
@ 2014-10-29 16:16 ` Emmanuel Grumbach
  0 siblings, 0 replies; 2+ messages in thread
From: Emmanuel Grumbach @ 2014-10-29 16:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Johannes Berg, Emmanuel Grumbach, Intel Linux Wireless,
	John W. Linville, Paul Gortmaker, Larry Finger, linux-wireless,
	netdev, linux-kernel, kernel-janitors

On Wed, Oct 29, 2014 at 6:08 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The shift operation is higher precedence so the code is wrong and it
> sets of a static checker warning.  But it doesn't affect real life
> because BT_UART_MSG_FRAME3SCOESCO_POS is zero so the shift is a no-op.
>
> I have re-written it in normal style and with parenthesis as a cleanup
> and to silence the static checker warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

In my tree already - I got it from Joe.

https://git.kernel.org/cgit/linux/kernel/git/iwlwifi/iwlwifi-next.git/commit/?id=50f6635afe565a0e1c5ab78f040294fe1dc41de0

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

end of thread, other threads:[~2014-10-29 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 16:08 [patch] iwlwifi: cleanup a mask shift in iwlagn_bt_traffic_is_sco() Dan Carpenter
2014-10-29 16:16 ` Emmanuel Grumbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).