iwlwifi: fix compile warning
authorReinette Chatre <reinette.chatre@intel.com>
Fri, 2 Oct 2009 20:43:57 +0000 (13:43 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:33:50 +0000 (16:33 -0400)
Fixes following on big endian systems:
  CC [M]  drivers/net/wireless/iwlwifi/iwl-rx.o
  drivers/net/wireless/iwlwifi/iwl-rx.c: In function ‘iwl_rx_reply_rx’:
  drivers/net/wireless/iwlwifi/iwl-rx.c:1029: warning: integer overflow in
  expression

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-rx.c

index e70c5b0..231c833 100644 (file)
@@ -610,7 +610,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
        if (rx_status.band == IEEE80211_BAND_5GHZ)
                rx_status.rate_idx -= IWL_FIRST_OFDM_RATE;
 
-       rx_status.antenna = le16_to_cpu(rx_hdr->phy_flags &
+       rx_status.antenna = (le16_to_cpu(rx_hdr->phy_flags) &
                                        RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
 
        /* set the preamble flag if appropriate */
index 2c5c88f..4afaf77 100644 (file)
@@ -1154,7 +1154,7 @@ struct iwl_wep_cmd {
 #define RX_RES_PHY_FLAGS_MOD_CCK_MSK           cpu_to_le16(1 << 1)
 #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK    cpu_to_le16(1 << 2)
 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK       cpu_to_le16(1 << 3)
-#define RX_RES_PHY_FLAGS_ANTENNA_MSK           cpu_to_le16(0xf0)
+#define RX_RES_PHY_FLAGS_ANTENNA_MSK           0xf0
 #define RX_RES_PHY_FLAGS_ANTENNA_POS           4
 
 #define RX_RES_STATUS_SEC_TYPE_MSK     (0x7 << 8)
index 8e1bb53..493626b 100644 (file)
@@ -1044,7 +1044,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
         * as a bitmask.
         */
        rx_status.antenna =
-               le16_to_cpu(phy_res->phy_flags & RX_RES_PHY_FLAGS_ANTENNA_MSK)
+               (le16_to_cpu(phy_res->phy_flags) & RX_RES_PHY_FLAGS_ANTENNA_MSK)
                >> RX_RES_PHY_FLAGS_ANTENNA_POS;
 
        /* set the preamble flag if appropriate */