wl12xx: fix some sparse warnings
authorEliad Peller <eliad@wizery.com>
Wed, 22 Dec 2010 11:38:52 +0000 (12:38 +0100)
committerLuciano Coelho <coelho@ti.com>
Mon, 24 Jan 2011 20:11:46 +0000 (22:11 +0200)
Note that wl1271_write32() calls cpu_to_le32() by itself, so calling
wl1271_write32(addr, cpu_to_le32(val)) is in fact a bug on BE systems.

Fix the following sparse warnings:

drivers/net/wireless/wl12xx/cmd.c:662:16: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:662:16:    expected unsigned short [unsigned] [addressable] [usertype] llc_type
drivers/net/wireless/wl12xx/cmd.c:662:16:    got restricted __be16 [usertype] <noident>
drivers/net/wireless/wl12xx/cmd.c:674:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:674:17:    expected unsigned int [unsigned] [addressable] [usertype] sender_ip
drivers/net/wireless/wl12xx/cmd.c:674:17:    got restricted __be32 [usertype] ip_addr
drivers/net/wireless/wl12xx/rx.c:202:4: warning: incorrect type in argument 3 (different base types)
drivers/net/wireless/wl12xx/rx.c:202:4:    expected unsigned int [unsigned] [usertype] val
drivers/net/wireless/wl12xx/rx.c:202:4:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/acx.c:1247:23: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/acx.c:1247:23:    expected restricted __le32 [usertype] ht_capabilites
drivers/net/wireless/wl12xx/acx.c:1247:23:    got unsigned long
drivers/net/wireless/wl12xx/acx.c:1250:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1250:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1250:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1253:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1253:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1253:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1256:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1256:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1256:24:    right side has type unsigned long

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/cmd.c
drivers/net/wireless/wl12xx/rx.c
drivers/net/wireless/wl12xx/wl12xx_80211.h

index cc4068d2b4a8443ca814bd25cf9c246f2095bf3c..17f6a63fbdea8f95b1d8b527f53c46cbff3c1e34 100644 (file)
@@ -1233,6 +1233,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
        struct wl1271_acx_ht_capabilities *acx;
        u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
        int ret = 0;
+       u32 ht_capabilites = 0;
 
        wl1271_debug(DEBUG_ACX, "acx ht capabilities setting");
 
@@ -1244,16 +1245,16 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
 
        /* Allow HT Operation ? */
        if (allow_ht_operation) {
-               acx->ht_capabilites =
+               ht_capabilites =
                        WL1271_ACX_FW_CAP_HT_OPERATION;
                if (ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD)
-                       acx->ht_capabilites |=
+                       ht_capabilites |=
                                WL1271_ACX_FW_CAP_GREENFIELD_FRAME_FORMAT;
                if (ht_cap->cap & IEEE80211_HT_CAP_SGI_20)
-                       acx->ht_capabilites |=
+                       ht_capabilites |=
                                WL1271_ACX_FW_CAP_SHORT_GI_FOR_20MHZ_PACKETS;
                if (ht_cap->cap & IEEE80211_HT_CAP_LSIG_TXOP_PROT)
-                       acx->ht_capabilites |=
+                       ht_capabilites |=
                                WL1271_ACX_FW_CAP_LSIG_TXOP_PROTECTION;
 
                /* get data from A-MPDU parameters field */
@@ -1261,10 +1262,10 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
                acx->ampdu_min_spacing = ht_cap->ampdu_density;
 
                memcpy(acx->mac_address, mac_address, ETH_ALEN);
-       } else { /* HT operations are not allowed */
-               acx->ht_capabilites = 0;
        }
 
+       acx->ht_capabilites = cpu_to_le32(ht_capabilites);
+
        ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx));
        if (ret < 0) {
                wl1271_warning("acx ht capabilities setting failed: %d", ret);
index 0106628aa5a2057c52da81386f2a471d769dc6a5..52a6bcd5c309fd31d5dd730a69fad8c42dfeb598 100644 (file)
@@ -659,15 +659,15 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr)
 
        /* llc layer */
        memcpy(tmpl.llc_hdr, rfc1042_header, sizeof(rfc1042_header));
-       tmpl.llc_type = htons(ETH_P_ARP);
+       tmpl.llc_type = cpu_to_be16(ETH_P_ARP);
 
        /* arp header */
        arp_hdr = &tmpl.arp_hdr;
-       arp_hdr->ar_hrd = htons(ARPHRD_ETHER);
-       arp_hdr->ar_pro = htons(ETH_P_IP);
+       arp_hdr->ar_hrd = cpu_to_be16(ARPHRD_ETHER);
+       arp_hdr->ar_pro = cpu_to_be16(ETH_P_IP);
        arp_hdr->ar_hln = ETH_ALEN;
        arp_hdr->ar_pln = 4;
-       arp_hdr->ar_op = htons(ARPOP_REPLY);
+       arp_hdr->ar_op = cpu_to_be16(ARPOP_REPLY);
 
        /* arp payload */
        memcpy(tmpl.sender_hw, wl->vif->addr, ETH_ALEN);
index ec8d843d41cfd4198f3dd4c7fe25f43d244a2e02..c6402529eac8a8c6e9e6e5f51b4b2fb093d1165a 100644 (file)
@@ -198,6 +198,5 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status)
                        pkt_offset += pkt_length;
                }
        }
-       wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS,
-                       cpu_to_le32(wl->rx_counter));
+       wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl->rx_counter);
 }
index be21032f4dc16047fa71dd8757d4d1bbb4db5825..e2b26fbf68c10256b26b4c2d4f2ab0d238cabc55 100644 (file)
@@ -138,13 +138,13 @@ struct wl12xx_arp_rsp_template {
        struct ieee80211_hdr_3addr hdr;
 
        u8 llc_hdr[sizeof(rfc1042_header)];
-       u16 llc_type;
+       __be16 llc_type;
 
        struct arphdr arp_hdr;
        u8 sender_hw[ETH_ALEN];
-       u32 sender_ip;
+       __be32 sender_ip;
        u8 target_hw[ETH_ALEN];
-       u32 target_ip;
+       __be32 target_ip;
 } __packed;