]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cxgb3 sparse warning fixes
authorStephen Hemminger <shemminger@linux-foundation.org>
Mon, 8 Oct 2007 23:22:29 +0000 (16:22 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:29 +0000 (16:55 -0700)
Fix warnings from sparse related to shadowed variables and routines
that should be declared static.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/cxgb3/cxgb3_main.c
drivers/net/cxgb3/cxgb3_offload.c
drivers/net/cxgb3/sge.c
drivers/net/cxgb3/t3_hw.c
drivers/net/cxgb3/xgmac.c

index e22d06531051b98f6e52597baa7671a2e76f86af..61ffc925eae777b065c37dea73c9b938e49ccd8e 100644 (file)
@@ -740,7 +740,7 @@ static inline char t3rev2char(struct adapter *adapter)
        return rev;
 }
 
-int update_tpsram(struct adapter *adap)
+static int update_tpsram(struct adapter *adap)
 {
        const struct firmware *tpsram;
        char buf[64];
@@ -1769,7 +1769,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
        }
        case CHELSIO_SET_QSET_NUM:{
                struct ch_reg edata;
-               struct port_info *pi = netdev_priv(dev);
                unsigned int i, first_qset = 0, other_qsets = 0;
 
                if (!capable(CAP_NET_ADMIN))
@@ -1801,7 +1800,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
        }
        case CHELSIO_GET_QSET_NUM:{
                struct ch_reg edata;
-               struct port_info *pi = netdev_priv(dev);
 
                edata.cmd = CHELSIO_GET_QSET_NUM;
                edata.val = pi->nqsets;
index 1c8eec38bde3c8118efdacc8e5271ed4536a7af5..bd25421bc12a67302eeeb6dcf81296c3c1d71ef2 100644 (file)
@@ -222,32 +222,32 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
        int ret = 0;
 
        switch (req) {
-       case RDMA_GET_PARAMS:{
-               struct rdma_info *req = data;
+       case RDMA_GET_PARAMS: {
+               struct rdma_info *rdma = data;
                struct pci_dev *pdev = adapter->pdev;
 
-               req->udbell_physbase = pci_resource_start(pdev, 2);
-               req->udbell_len = pci_resource_len(pdev, 2);
-               req->tpt_base =
+               rdma->udbell_physbase = pci_resource_start(pdev, 2);
+               rdma->udbell_len = pci_resource_len(pdev, 2);
+               rdma->tpt_base =
                        t3_read_reg(adapter, A_ULPTX_TPT_LLIMIT);
-               req->tpt_top = t3_read_reg(adapter, A_ULPTX_TPT_ULIMIT);
-               req->pbl_base =
+               rdma->tpt_top = t3_read_reg(adapter, A_ULPTX_TPT_ULIMIT);
+               rdma->pbl_base =
                        t3_read_reg(adapter, A_ULPTX_PBL_LLIMIT);
-               req->pbl_top = t3_read_reg(adapter, A_ULPTX_PBL_ULIMIT);
-               req->rqt_base = t3_read_reg(adapter, A_ULPRX_RQ_LLIMIT);
-               req->rqt_top = t3_read_reg(adapter, A_ULPRX_RQ_ULIMIT);
-               req->kdb_addr = adapter->regs + A_SG_KDOORBELL;
-               req->pdev = pdev;
+               rdma->pbl_top = t3_read_reg(adapter, A_ULPTX_PBL_ULIMIT);
+               rdma->rqt_base = t3_read_reg(adapter, A_ULPRX_RQ_LLIMIT);
+               rdma->rqt_top = t3_read_reg(adapter, A_ULPRX_RQ_ULIMIT);
+               rdma->kdb_addr = adapter->regs + A_SG_KDOORBELL;
+               rdma->pdev = pdev;
                break;
        }
        case RDMA_CQ_OP:{
                unsigned long flags;
-               struct rdma_cq_op *req = data;
+               struct rdma_cq_op *rdma = data;
 
                /* may be called in any context */
                spin_lock_irqsave(&adapter->sge.reg_lock, flags);
-               ret = t3_sge_cqcntxt_op(adapter, req->id, req->op,
-                                       req->credits);
+               ret = t3_sge_cqcntxt_op(adapter, rdma->id, rdma->op,
+                                       rdma->credits);
                spin_unlock_irqrestore(&adapter->sge.reg_lock, flags);
                break;
        }
@@ -274,15 +274,15 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
                break;
        }
        case RDMA_CQ_SETUP:{
-               struct rdma_cq_setup *req = data;
+               struct rdma_cq_setup *rdma = data;
 
                spin_lock_irq(&adapter->sge.reg_lock);
                ret =
-                       t3_sge_init_cqcntxt(adapter, req->id,
-                                       req->base_addr, req->size,
+                       t3_sge_init_cqcntxt(adapter, rdma->id,
+                                       rdma->base_addr, rdma->size,
                                        ASYNC_NOTIF_RSPQ,
-                                       req->ovfl_mode, req->credits,
-                                       req->credit_thres);
+                                       rdma->ovfl_mode, rdma->credits,
+                                       rdma->credit_thres);
                spin_unlock_irq(&adapter->sge.reg_lock);
                break;
        }
@@ -292,13 +292,13 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
                spin_unlock_irq(&adapter->sge.reg_lock);
                break;
        case RDMA_CTRL_QP_SETUP:{
-               struct rdma_ctrlqp_setup *req = data;
+               struct rdma_ctrlqp_setup *rdma = data;
 
                spin_lock_irq(&adapter->sge.reg_lock);
                ret = t3_sge_init_ecntxt(adapter, FW_RI_SGEEC_START, 0,
                                                SGE_CNTXT_RDMA,
                                                ASYNC_NOTIF_RSPQ,
-                                               req->base_addr, req->size,
+                                               rdma->base_addr, rdma->size,
                                                FW_RI_TID_START, 1, 0);
                spin_unlock_irq(&adapter->sge.reg_lock);
                break;
index 77f3ec5ff8a7cef200a9c6a640abdf0ee15eb6ac..994b5d6404df3568113b462b70d6d044b03b740e 100644 (file)
@@ -544,7 +544,7 @@ static void *alloc_ring(struct pci_dev *pdev, size_t nelem, size_t elem_size,
  *     as HW contexts, packet buffers, and descriptor rings.  Traffic to the
  *     queue set must be quiesced prior to calling this.
  */
-void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
+static void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
 {
        int i;
        struct pci_dev *pdev = adapter->pdev;
@@ -2215,7 +2215,7 @@ irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
  * The MSI-X interrupt handler for an SGE response queue for the NAPI case
  * (i.e., response queue serviced by NAPI polling).
  */
-irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
+static irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
 {
        struct sge_qset *qs = cookie;
        struct sge_rspq *q = &qs->rspq;
@@ -2284,7 +2284,7 @@ static int rspq_check_napi(struct sge_qset *qs)
  * one SGE response queue per port in this mode and protect all response
  * queues with queue 0's lock.
  */
-irqreturn_t t3_intr_msi_napi(int irq, void *cookie)
+static irqreturn_t t3_intr_msi_napi(int irq, void *cookie)
 {
        int new_packets;
        struct adapter *adap = cookie;
index 058329321440f7c4d9804308ee6efa32ace7913b..d4ee00d32219c5a045bf0affad6d08f4853e23b2 100644 (file)
@@ -119,9 +119,9 @@ void t3_set_reg_field(struct adapter *adapter, unsigned int addr, u32 mask,
  *     Reads registers that are accessed indirectly through an address/data
  *     register pair.
  */
-void t3_read_indirect(struct adapter *adap, unsigned int addr_reg,
-                     unsigned int data_reg, u32 *vals, unsigned int nregs,
-                     unsigned int start_idx)
+static void t3_read_indirect(struct adapter *adap, unsigned int addr_reg,
+                            unsigned int data_reg, u32 *vals,
+                            unsigned int nregs, unsigned int start_idx)
 {
        while (nregs--) {
                t3_write_reg(adap, addr_reg, start_idx);
@@ -3407,7 +3407,7 @@ void early_hw_init(struct adapter *adapter, const struct adapter_info *ai)
  * Older PCIe cards lose their config space during reset, PCI-X
  * ones don't.
  */
-int t3_reset_adapter(struct adapter *adapter)
+static int t3_reset_adapter(struct adapter *adapter)
 {
        int i, save_and_restore_pcie = 
            adapter->params.rev < T3_REV_B2 && is_pcie(adapter);
index bcb5bc4e649b11eedf61b164762f4e6ed1ce85ff..eeb766aeced951ea72fb4a20837cc909cad54555 100644 (file)
@@ -142,7 +142,7 @@ int t3_mac_reset(struct cmac *mac)
        return 0;
 }
 
-int t3b2_mac_reset(struct cmac *mac)
+static int t3b2_mac_reset(struct cmac *mac)
 {
        struct adapter *adap = mac->adapter;
        unsigned int oft = mac->offset;