From patchwork Tue Jul 20 18:07:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John W. Linville" X-Patchwork-Id: 113043 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6KIeGQP025476 for ; Tue, 20 Jul 2010 18:43:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758570Ab0GTSPO (ORCPT ); Tue, 20 Jul 2010 14:15:14 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:34763 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758567Ab0GTSPN (ORCPT ); Tue, 20 Jul 2010 14:15:13 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1ObHLT-0006Tc-O8; Tue, 20 Jul 2010 14:15:11 -0400 Received: from linville-t400.local (linville-t400.local [127.0.0.1]) by linville-t400.local (8.14.4/8.14.3) with ESMTP id o6KI731f003078; Tue, 20 Jul 2010 14:07:03 -0400 Received: (from linville@localhost) by linville-t400.local (8.14.4/8.14.4/Submit) id o6KI73HR003076; Tue, 20 Jul 2010 14:07:03 -0400 From: "John W. Linville" To: linux-wireless@vger.kernel.org Cc: Lennert Buytenhek , "John W. Linville" Subject: [PATCH] mwl8k: correct/silence sparse warnings Date: Tue, 20 Jul 2010 14:07:02 -0400 Message-Id: <1279649222-3042-1-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 1.7.1.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 20 Jul 2010 18:43:18 +0000 (UTC) diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index cd37b2a..3576071 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -314,13 +314,15 @@ static const struct ieee80211_rate mwl8k_rates_50[] = { #define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */ #define MWL8K_CMD_UPDATE_STADB 0x1123 -static const char *mwl8k_cmd_name(u16 cmd, char *buf, int bufsize) +static const char *mwl8k_cmd_name(__le16 cmd, char *buf, int bufsize) { + u16 command = le16_to_cpu(cmd); + #define MWL8K_CMDNAME(x) case MWL8K_CMD_##x: do {\ snprintf(buf, bufsize, "%s", #x);\ return buf;\ } while (0) - switch (cmd & ~0x8000) { + switch (command & ~0x8000) { MWL8K_CMDNAME(CODE_DNLD); MWL8K_CMDNAME(GET_HW_SPEC); MWL8K_CMDNAME(SET_HW_SPEC); @@ -1538,7 +1540,7 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) unsigned long timeout = 0; u8 buf[32]; - cmd->result = 0xffff; + cmd->result = (__force __le16) 0xffff; dma_size = le16_to_cpu(cmd->length); dma_addr = pci_map_single(priv->pdev, cmd, dma_size, PCI_DMA_BIDIRECTIONAL); @@ -1842,22 +1844,28 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw) priv->sta_macids_supported = 0x00000000; off = le32_to_cpu(cmd->wcbbase0) & 0xffff; - iowrite32(cpu_to_le32(priv->txq[0].txd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->txq[0].txd_dma), + priv->sram + off); off = le32_to_cpu(cmd->rxwrptr) & 0xffff; - iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->rxq[0].rxd_dma), + priv->sram + off); off = le32_to_cpu(cmd->rxrdptr) & 0xffff; - iowrite32(cpu_to_le32(priv->rxq[0].rxd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->rxq[0].rxd_dma), + priv->sram + off); off = le32_to_cpu(cmd->wcbbase1) & 0xffff; - iowrite32(cpu_to_le32(priv->txq[1].txd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->txq[1].txd_dma), + priv->sram + off); off = le32_to_cpu(cmd->wcbbase2) & 0xffff; - iowrite32(cpu_to_le32(priv->txq[2].txd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->txq[2].txd_dma), + priv->sram + off); off = le32_to_cpu(cmd->wcbbase3) & 0xffff; - iowrite32(cpu_to_le32(priv->txq[3].txd_dma), priv->sram + off); + iowrite32((__force __u32) cpu_to_le32(priv->txq[3].txd_dma), + priv->sram + off); } kfree(cmd); @@ -3052,7 +3060,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw, p->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; p->basic_caps = cpu_to_le16(vif->bss_conf.assoc_capability); p->ht_support = sta->ht_cap.ht_supported; - p->ht_caps = sta->ht_cap.cap; + p->ht_caps = cpu_to_le16(sta->ht_cap.cap); p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) | ((sta->ht_cap.ampdu_density & 7) << 2); if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)