From patchwork Thu Jul 22 18:24:01 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: 113695 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 o6MIUcpO022064 for ; Thu, 22 Jul 2010 18:30:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758544Ab0GVSaQ (ORCPT ); Thu, 22 Jul 2010 14:30:16 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:54821 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450Ab0GVSaM (ORCPT ); Thu, 22 Jul 2010 14:30:12 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1Oc0X5-0002pQ-7d; Thu, 22 Jul 2010 14:30: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 o6MIO10n021190; Thu, 22 Jul 2010 14:24:01 -0400 Received: (from linville@localhost) by linville-t400.local (8.14.4/8.14.4/Submit) id o6MIO1vH021189; Thu, 22 Jul 2010 14:24:01 -0400 From: "John W. Linville" To: linux-wireless@vger.kernel.org Cc: "John W. Linville" Subject: [PATCH] atmel: silence sparse warnings Date: Thu, 22 Jul 2010 14:24:01 -0400 Message-Id: <1279823041-21156-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]); Thu, 22 Jul 2010 18:30:39 +0000 (UTC) diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index c8f7090..008d712 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c @@ -3617,6 +3617,7 @@ static void atmel_command_irq(struct atmel_private *priv) static int atmel_wakeup_firmware(struct atmel_private *priv) { struct host_info_struct *iface = &priv->host_info; + u8 buf[sizeof(struct host_info_struct)]; u16 mr1, mr3; int i; @@ -3688,23 +3689,61 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) return -EIO; } - atmel_copy_to_host(priv->dev, (unsigned char *)iface, - priv->host_info_base, sizeof(*iface)); - - iface->tx_buff_pos = le16_to_cpu(iface->tx_buff_pos); - iface->tx_buff_size = le16_to_cpu(iface->tx_buff_size); - iface->tx_desc_pos = le16_to_cpu(iface->tx_desc_pos); - iface->tx_desc_count = le16_to_cpu(iface->tx_desc_count); - iface->rx_buff_pos = le16_to_cpu(iface->rx_buff_pos); - iface->rx_buff_size = le16_to_cpu(iface->rx_buff_size); - iface->rx_desc_pos = le16_to_cpu(iface->rx_desc_pos); - iface->rx_desc_count = le16_to_cpu(iface->rx_desc_count); - iface->build_version = le16_to_cpu(iface->build_version); - iface->command_pos = le16_to_cpu(iface->command_pos); - iface->major_version = le16_to_cpu(iface->major_version); - iface->minor_version = le16_to_cpu(iface->minor_version); - iface->func_ctrl = le16_to_cpu(iface->func_ctrl); - iface->mac_status = le16_to_cpu(iface->mac_status); + atmel_copy_to_host(priv->dev, (unsigned char *)&buf, + priv->host_info_base, sizeof(buf)); + + iface->int_status = buf[offsetof(struct host_info_struct, + int_status)]; + iface->int_mask = buf[offsetof(struct host_info_struct, int_mask)]; + iface->lockout_host = buf[offsetof(struct host_info_struct, + lockout_host)]; + iface->lockout_mac = buf[offsetof(struct host_info_struct, + lockout_mac)]; + iface->tx_buff_pos = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + tx_buff_pos)]); + iface->tx_buff_size = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + tx_buff_size)]); + iface->tx_desc_pos = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + tx_desc_pos)]); + iface->tx_desc_count = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + tx_desc_count)]); + iface->rx_buff_pos = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + rx_buff_pos)]); + iface->rx_buff_size = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + rx_buff_size)]); + iface->rx_desc_pos = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + rx_desc_pos)]); + iface->rx_desc_count = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + rx_desc_count)]); + iface->build_version = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + build_version)]); + iface->command_pos = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + command_pos)]); + iface->major_version = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + major_version)]); + iface->minor_version = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + minor_version)]); + iface->func_ctrl = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + func_ctrl)]); + iface->mac_status = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + mac_status)]); + iface->generic_IRQ_type = + le16_to_cpu(*(__le16 *)&buf[offsetof(struct host_info_struct, + generic_IRQ_type)]); return 0; }