qlcnic: sparse warning fixes
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Mon, 4 Oct 2010 04:20:14 +0000 (04:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Oct 2010 05:46:51 +0000 (22:46 -0700)
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_ctx.c
drivers/net/qlcnic/qlcnic_main.c

index a4c4d091739ef1c73f9ce18e84ed04c1a6fd2f5c..75e3b19e35eec1b1e3f1f1889e4b2953672e404d 100644 (file)
@@ -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 {
index 6001f41a70ad262954196ab92d99d0850c109fa6..59a2138143343c838d5a74e16b4fdad24be7fd33 100644 (file)
@@ -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 ;