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 e70c5b0af364d35b796a6bad2447aaedfd82e4d5..231c833f64692671cfc763e66461cc0d87eab88b 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;
 
        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 */
                                        RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
 
        /* set the preamble flag if appropriate */
index 2c5c88fc38f5456e665310b2d7feffb5b011ae3d..4afaf773aeac1c501c00e79183d363d3791f08fa 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_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)
 #define RX_RES_PHY_FLAGS_ANTENNA_POS           4
 
 #define RX_RES_STATUS_SEC_TYPE_MSK     (0x7 << 8)
index 8e1bb53c0aa3ffe1fa14291c88a697670f89836c..493626bcd3ec53102f7d5d00c15cc5a7045588dd 100644 (file)
@@ -1044,7 +1044,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
         * as a bitmask.
         */
        rx_status.antenna =
         * 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 */
                >> RX_RES_PHY_FLAGS_ANTENNA_POS;
 
        /* set the preamble flag if appropriate */