Return-path: Received: from mail-wg0-f45.google.com ([74.125.82.45]:64788 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932710AbaJ2Lvc (ORCPT ); Wed, 29 Oct 2014 07:51:32 -0400 Received: by mail-wg0-f45.google.com with SMTP id x12so1672566wgg.32 for ; Wed, 29 Oct 2014 04:51:31 -0700 (PDT) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Joe Perches , Emmanuel Grumbach Subject: [PATCH 20/25] iwlwifi: dvm: Fix probable mask then right shift defect Date: Wed, 29 Oct 2014 13:50:41 +0200 Message-Id: <1414583446-11032-20-git-send-email-egrumbach@gmail.com> (sfid-20141029_131321_236147_0F4E3E55) In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Joe Perches Precedence of & and >> is not the same and is not left to right. shift has higher precedence and should be done after the mask. Add parentheses around the mask. Signed-off-by: Joe Perches Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/dvm/lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c index 2191621..02e4ede 100644 --- a/drivers/net/wireless/iwlwifi/dvm/lib.c +++ b/drivers/net/wireless/iwlwifi/dvm/lib.c @@ -418,8 +418,8 @@ 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 >> - BT_UART_MSG_FRAME3SCOESCO_POS; + return (BT_UART_MSG_FRAME3SCOESCO_MSK & uart_msg->frame3) >> + BT_UART_MSG_FRAME3SCOESCO_POS; } static void iwlagn_bt_traffic_change_work(struct work_struct *work) -- 1.9.1