iwlwifi: fix some warnings
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 1 Apr 2008 15:51:47 +0000 (17:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Apr 2008 20:43:50 +0000 (16:43 -0400)
This fixes all kinds of warnings in iwlwifi.

Signed-off-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-3945.h
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-4965.h

index eb30819cddc476d71b22f7081ef54b0321d041cd..0d3cc3559039879f87bea73b525b0ce026bee973 100644 (file)
@@ -524,7 +524,7 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
        s8 noise = 0;
        int rate = stats->rate_idx;
        u64 tsf = stats->mactime;
-       __le16 phy_flags_hw = rx_hdr->phy_flags;
+       __le16 phy_flags_hw = rx_hdr->phy_flags, antenna;
 
        struct iwl3945_rt_rx_hdr {
                struct ieee80211_radiotap_header rt_hdr;
@@ -596,8 +596,8 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
                iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee;
 
        /* antenna number */
-       iwl3945_rt->rt_antenna =
-               le16_to_cpu(phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
+       antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;
+       iwl3945_rt->rt_antenna = le16_to_cpu(antenna) >> 4;
 
        /* set the preamble flag if we have it */
        if (phy_flags_hw & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
index ac1226946aa69b5e8a1893947552b7c495d92e4f..333c850772115078476a0989a5bd331dd2727d63 100644 (file)
@@ -280,8 +280,8 @@ struct iwl3945_frame {
 
 #define SEQ_TO_QUEUE(x)  ((x >> 8) & 0xbf)
 #define QUEUE_TO_SEQ(x)  ((x & 0xbf) << 8)
-#define SEQ_TO_INDEX(x) (x & 0xff)
-#define INDEX_TO_SEQ(x) (x & 0xff)
+#define SEQ_TO_INDEX(x) ((u8)(x & 0xff))
+#define INDEX_TO_SEQ(x) ((u8)(x & 0xff))
 #define SEQ_HUGE_FRAME  (0x4000)
 #define SEQ_RX_FRAME    __constant_cpu_to_le16(0x8000)
 #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
index 0171bb8cbbc6be1acc90145e0fab83a6e6ea86e2..73e8a24eb9ce8d3c7c4c9b1a91b91c557b9435aa 100644 (file)
@@ -3296,6 +3296,7 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
        s8 noise = 0;
        int rate = stats->rate_idx;
        u64 tsf = stats->mactime;
+       __le16 antenna;
        __le16 phy_flags_hw = rx_start->phy_flags;
        struct iwl4965_rt_rx_hdr {
                struct ieee80211_radiotap_header rt_hdr;
@@ -3380,8 +3381,8 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
         * new 802.11n radiotap field "RX chains" that is defined
         * as a bitmask.
         */
-       iwl4965_rt->rt_antenna =
-               le16_to_cpu(phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4;
+       antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;
+       iwl4965_rt->rt_antenna = le16_to_cpu(antenna) >> 4;
 
        /* set the preamble flag if appropriate */
        if (phy_flags_hw & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
index c8e7028cdf2a715ddbcc9014ba68a490aeeba114..0ec217da48d452fa20a9874bcf98b0dc9bf97285 100644 (file)
@@ -294,8 +294,8 @@ struct iwl4965_frame {
 
 #define SEQ_TO_QUEUE(x)  ((x >> 8) & 0xbf)
 #define QUEUE_TO_SEQ(x)  ((x & 0xbf) << 8)
-#define SEQ_TO_INDEX(x) (x & 0xff)
-#define INDEX_TO_SEQ(x) (x & 0xff)
+#define SEQ_TO_INDEX(x) ((u8)(x & 0xff))
+#define INDEX_TO_SEQ(x) ((u8)(x & 0xff))
 #define SEQ_HUGE_FRAME  (0x4000)
 #define SEQ_RX_FRAME    __constant_cpu_to_le16(0x8000)
 #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)