From patchwork Mon Oct 4 15:14:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: amit salecha X-Patchwork-Id: 90674 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 02F21B6F10 for ; Tue, 12 Apr 2011 08:52:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756309Ab1DKWwf (ORCPT ); Mon, 11 Apr 2011 18:52:35 -0400 Received: from mvnat01.qlogic.com ([198.186.3.73]:26773 "EHLO dut4145.unminc.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756135Ab1DKWwK (ORCPT ); Mon, 11 Apr 2011 18:52:10 -0400 Received: from dut4145.unminc.com (localhost.localdomain [127.0.0.1]) by dut4145.unminc.com (8.13.8/8.13.8) with ESMTP id p3BNmExI018025; Mon, 11 Apr 2011 16:51:57 -0700 Received: (from amit@localhost) by dut4145.unminc.com (8.13.8/8.13.8/Submit) id o94FF1jv023259; Mon, 4 Oct 2010 08:15:01 -0700 X-Authentication-Warning: dut4145.unminc.com: amit set sender to amit.salecha@qlogic.com using -f From: Amit Kumar Salecha To: davem@davemloft.net Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com, anirban.chakraborty@qlogic.com, Sucheta Chakraborty Subject: [PATCHv2 NEXT 6/8] qlcnic: sparse warning fixes Date: Mon, 4 Oct 2010 08:14:55 -0700 Message-Id: <1286205297-23214-6-git-send-email-amit.salecha@qlogic.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1286205297-23214-1-git-send-email-amit.salecha@qlogic.com> References: <1286205297-23214-1-git-send-email-amit.salecha@qlogic.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sucheta Chakraborty Signed-off-by: Sucheta Chakraborty Signed-off-by: Amit Kumar Salecha --- drivers/net/qlcnic/qlcnic_ctx.c | 12 ++++++------ drivers/net/qlcnic/qlcnic_main.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c index a4c4d09..75e3b19 100644 --- a/drivers/net/qlcnic/qlcnic_ctx.c +++ b/drivers/net/qlcnic/qlcnic_ctx.c @@ -742,15 +742,15 @@ int qlcnic_get_pci_info(struct qlcnic_adapter *adapter, if (err == QLCNIC_RCODE_SUCCESS) { for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++, npar++, pci_info++) { - pci_info->id = le32_to_cpu(npar->id); - pci_info->active = le32_to_cpu(npar->active); - pci_info->type = le32_to_cpu(npar->type); + pci_info->id = le16_to_cpu(npar->id); + pci_info->active = le16_to_cpu(npar->active); + pci_info->type = le16_to_cpu(npar->type); pci_info->default_port = - le32_to_cpu(npar->default_port); + le16_to_cpu(npar->default_port); pci_info->tx_min_bw = - le32_to_cpu(npar->tx_min_bw); + le16_to_cpu(npar->tx_min_bw); pci_info->tx_max_bw = - le32_to_cpu(npar->tx_max_bw); + le16_to_cpu(npar->tx_max_bw); memcpy(pci_info->mac, npar->mac, ETH_ALEN); } } else { diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 6001f41..59a2138 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -521,9 +521,9 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter) pfn = pci_info[i].id; if (pfn > QLCNIC_MAX_PCI_FUNC) return QL_STATUS_INVALID_PARAM; - adapter->npars[pfn].active = pci_info[i].active; - adapter->npars[pfn].type = pci_info[i].type; - adapter->npars[pfn].phy_port = pci_info[i].default_port; + adapter->npars[pfn].active = (u8)pci_info[i].active; + adapter->npars[pfn].type = (u8)pci_info[i].type; + adapter->npars[pfn].phy_port = (u8)pci_info[i].default_port; adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw; adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw; } @@ -723,7 +723,7 @@ qlcnic_initialize_nic(struct qlcnic_adapter *adapter) if (err) return err; - adapter->physical_port = nic_info.phys_port; + adapter->physical_port = (u8)nic_info.phys_port; adapter->switch_mode = nic_info.switch_mode; adapter->max_tx_ques = nic_info.max_tx_ques; adapter->max_rx_ques = nic_info.max_rx_ques; @@ -3762,7 +3762,7 @@ qlcnic_sysfs_read_npar_config(struct file *file, struct kobject *kobj, return ret; np_cfg[i].pci_func = i; - np_cfg[i].op_mode = nic_info.op_mode; + np_cfg[i].op_mode = (u8)nic_info.op_mode; np_cfg[i].port_num = nic_info.phys_port; np_cfg[i].fw_capab = nic_info.capabilities; np_cfg[i].min_bw = nic_info.min_tx_bw ;