aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-08 19:22:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:29 -0400
commit9265fabf0d4c3d0a52e169d4b9149d52fd91db69 (patch)
tree3e3f642719fd05cc2cd4759d7365b10ac89dda2c /drivers/net/cxgb3
parent33a85aa1c915c2f114bdac9b6d1ec00cc0fbc485 (diff)
cxgb3 sparse warning fixes
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>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c4
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c44
-rw-r--r--drivers/net/cxgb3/sge.c6
-rw-r--r--drivers/net/cxgb3/t3_hw.c8
-rw-r--r--drivers/net/cxgb3/xgmac.c2
5 files changed, 31 insertions, 33 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index e22d06531051..61ffc925eae7 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -740,7 +740,7 @@ static inline char t3rev2char(struct adapter *adapter)
740 return rev; 740 return rev;
741} 741}
742 742
743int update_tpsram(struct adapter *adap) 743static int update_tpsram(struct adapter *adap)
744{ 744{
745 const struct firmware *tpsram; 745 const struct firmware *tpsram;
746 char buf[64]; 746 char buf[64];
@@ -1769,7 +1769,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1769 } 1769 }
1770 case CHELSIO_SET_QSET_NUM:{ 1770 case CHELSIO_SET_QSET_NUM:{
1771 struct ch_reg edata; 1771 struct ch_reg edata;
1772 struct port_info *pi = netdev_priv(dev);
1773 unsigned int i, first_qset = 0, other_qsets = 0; 1772 unsigned int i, first_qset = 0, other_qsets = 0;
1774 1773
1775 if (!capable(CAP_NET_ADMIN)) 1774 if (!capable(CAP_NET_ADMIN))
@@ -1801,7 +1800,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1801 } 1800 }
1802 case CHELSIO_GET_QSET_NUM:{ 1801 case CHELSIO_GET_QSET_NUM:{
1803 struct ch_reg edata; 1802 struct ch_reg edata;
1804 struct port_info *pi = netdev_priv(dev);
1805 1803
1806 edata.cmd = CHELSIO_GET_QSET_NUM; 1804 edata.cmd = CHELSIO_GET_QSET_NUM;
1807 edata.val = pi->nqsets; 1805 edata.val = pi->nqsets;
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 1c8eec38bde3..bd25421bc12a 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -222,32 +222,32 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
222 int ret = 0; 222 int ret = 0;
223 223
224 switch (req) { 224 switch (req) {
225 case RDMA_GET_PARAMS:{ 225 case RDMA_GET_PARAMS: {
226 struct rdma_info *req = data; 226 struct rdma_info *rdma = data;
227 struct pci_dev *pdev = adapter->pdev; 227 struct pci_dev *pdev = adapter->pdev;
228 228
229 req->udbell_physbase = pci_resource_start(pdev, 2); 229 rdma->udbell_physbase = pci_resource_start(pdev, 2);
230 req->udbell_len = pci_resource_len(pdev, 2); 230 rdma->udbell_len = pci_resource_len(pdev, 2);
231 req->tpt_base = 231 rdma->tpt_base =
232 t3_read_reg(adapter, A_ULPTX_TPT_LLIMIT); 232 t3_read_reg(adapter, A_ULPTX_TPT_LLIMIT);
233 req->tpt_top = t3_read_reg(adapter, A_ULPTX_TPT_ULIMIT); 233 rdma->tpt_top = t3_read_reg(adapter, A_ULPTX_TPT_ULIMIT);
234 req->pbl_base = 234 rdma->pbl_base =
235 t3_read_reg(adapter, A_ULPTX_PBL_LLIMIT); 235 t3_read_reg(adapter, A_ULPTX_PBL_LLIMIT);
236 req->pbl_top = t3_read_reg(adapter, A_ULPTX_PBL_ULIMIT); 236 rdma->pbl_top = t3_read_reg(adapter, A_ULPTX_PBL_ULIMIT);
237 req->rqt_base = t3_read_reg(adapter, A_ULPRX_RQ_LLIMIT); 237 rdma->rqt_base = t3_read_reg(adapter, A_ULPRX_RQ_LLIMIT);
238 req->rqt_top = t3_read_reg(adapter, A_ULPRX_RQ_ULIMIT); 238 rdma->rqt_top = t3_read_reg(adapter, A_ULPRX_RQ_ULIMIT);
239 req->kdb_addr = adapter->regs + A_SG_KDOORBELL; 239 rdma->kdb_addr = adapter->regs + A_SG_KDOORBELL;
240 req->pdev = pdev; 240 rdma->pdev = pdev;
241 break; 241 break;
242 } 242 }
243 case RDMA_CQ_OP:{ 243 case RDMA_CQ_OP:{
244 unsigned long flags; 244 unsigned long flags;
245 struct rdma_cq_op *req = data; 245 struct rdma_cq_op *rdma = data;
246 246
247 /* may be called in any context */ 247 /* may be called in any context */
248 spin_lock_irqsave(&adapter->sge.reg_lock, flags); 248 spin_lock_irqsave(&adapter->sge.reg_lock, flags);
249 ret = t3_sge_cqcntxt_op(adapter, req->id, req->op, 249 ret = t3_sge_cqcntxt_op(adapter, rdma->id, rdma->op,
250 req->credits); 250 rdma->credits);
251 spin_unlock_irqrestore(&adapter->sge.reg_lock, flags); 251 spin_unlock_irqrestore(&adapter->sge.reg_lock, flags);
252 break; 252 break;
253 } 253 }
@@ -274,15 +274,15 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
274 break; 274 break;
275 } 275 }
276 case RDMA_CQ_SETUP:{ 276 case RDMA_CQ_SETUP:{
277 struct rdma_cq_setup *req = data; 277 struct rdma_cq_setup *rdma = data;
278 278
279 spin_lock_irq(&adapter->sge.reg_lock); 279 spin_lock_irq(&adapter->sge.reg_lock);
280 ret = 280 ret =
281 t3_sge_init_cqcntxt(adapter, req->id, 281 t3_sge_init_cqcntxt(adapter, rdma->id,
282 req->base_addr, req->size, 282 rdma->base_addr, rdma->size,
283 ASYNC_NOTIF_RSPQ, 283 ASYNC_NOTIF_RSPQ,
284 req->ovfl_mode, req->credits, 284 rdma->ovfl_mode, rdma->credits,
285 req->credit_thres); 285 rdma->credit_thres);
286 spin_unlock_irq(&adapter->sge.reg_lock); 286 spin_unlock_irq(&adapter->sge.reg_lock);
287 break; 287 break;
288 } 288 }
@@ -292,13 +292,13 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
292 spin_unlock_irq(&adapter->sge.reg_lock); 292 spin_unlock_irq(&adapter->sge.reg_lock);
293 break; 293 break;
294 case RDMA_CTRL_QP_SETUP:{ 294 case RDMA_CTRL_QP_SETUP:{
295 struct rdma_ctrlqp_setup *req = data; 295 struct rdma_ctrlqp_setup *rdma = data;
296 296
297 spin_lock_irq(&adapter->sge.reg_lock); 297 spin_lock_irq(&adapter->sge.reg_lock);
298 ret = t3_sge_init_ecntxt(adapter, FW_RI_SGEEC_START, 0, 298 ret = t3_sge_init_ecntxt(adapter, FW_RI_SGEEC_START, 0,
299 SGE_CNTXT_RDMA, 299 SGE_CNTXT_RDMA,
300 ASYNC_NOTIF_RSPQ, 300 ASYNC_NOTIF_RSPQ,
301 req->base_addr, req->size, 301 rdma->base_addr, rdma->size,
302 FW_RI_TID_START, 1, 0); 302 FW_RI_TID_START, 1, 0);
303 spin_unlock_irq(&adapter->sge.reg_lock); 303 spin_unlock_irq(&adapter->sge.reg_lock);
304 break; 304 break;
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 77f3ec5ff8a7..994b5d6404df 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -544,7 +544,7 @@ static void *alloc_ring(struct pci_dev *pdev, size_t nelem, size_t elem_size,
544 * as HW contexts, packet buffers, and descriptor rings. Traffic to the 544 * as HW contexts, packet buffers, and descriptor rings. Traffic to the
545 * queue set must be quiesced prior to calling this. 545 * queue set must be quiesced prior to calling this.
546 */ 546 */
547void t3_free_qset(struct adapter *adapter, struct sge_qset *q) 547static void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
548{ 548{
549 int i; 549 int i;
550 struct pci_dev *pdev = adapter->pdev; 550 struct pci_dev *pdev = adapter->pdev;
@@ -2215,7 +2215,7 @@ irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2215 * The MSI-X interrupt handler for an SGE response queue for the NAPI case 2215 * The MSI-X interrupt handler for an SGE response queue for the NAPI case
2216 * (i.e., response queue serviced by NAPI polling). 2216 * (i.e., response queue serviced by NAPI polling).
2217 */ 2217 */
2218irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie) 2218static irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
2219{ 2219{
2220 struct sge_qset *qs = cookie; 2220 struct sge_qset *qs = cookie;
2221 struct sge_rspq *q = &qs->rspq; 2221 struct sge_rspq *q = &qs->rspq;
@@ -2284,7 +2284,7 @@ static int rspq_check_napi(struct sge_qset *qs)
2284 * one SGE response queue per port in this mode and protect all response 2284 * one SGE response queue per port in this mode and protect all response
2285 * queues with queue 0's lock. 2285 * queues with queue 0's lock.
2286 */ 2286 */
2287irqreturn_t t3_intr_msi_napi(int irq, void *cookie) 2287static irqreturn_t t3_intr_msi_napi(int irq, void *cookie)
2288{ 2288{
2289 int new_packets; 2289 int new_packets;
2290 struct adapter *adap = cookie; 2290 struct adapter *adap = cookie;
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 058329321440..d4ee00d32219 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -119,9 +119,9 @@ void t3_set_reg_field(struct adapter *adapter, unsigned int addr, u32 mask,
119 * Reads registers that are accessed indirectly through an address/data 119 * Reads registers that are accessed indirectly through an address/data
120 * register pair. 120 * register pair.
121 */ 121 */
122void t3_read_indirect(struct adapter *adap, unsigned int addr_reg, 122static void t3_read_indirect(struct adapter *adap, unsigned int addr_reg,
123 unsigned int data_reg, u32 *vals, unsigned int nregs, 123 unsigned int data_reg, u32 *vals,
124 unsigned int start_idx) 124 unsigned int nregs, unsigned int start_idx)
125{ 125{
126 while (nregs--) { 126 while (nregs--) {
127 t3_write_reg(adap, addr_reg, start_idx); 127 t3_write_reg(adap, addr_reg, start_idx);
@@ -3407,7 +3407,7 @@ void early_hw_init(struct adapter *adapter, const struct adapter_info *ai)
3407 * Older PCIe cards lose their config space during reset, PCI-X 3407 * Older PCIe cards lose their config space during reset, PCI-X
3408 * ones don't. 3408 * ones don't.
3409 */ 3409 */
3410int t3_reset_adapter(struct adapter *adapter) 3410static int t3_reset_adapter(struct adapter *adapter)
3411{ 3411{
3412 int i, save_and_restore_pcie = 3412 int i, save_and_restore_pcie =
3413 adapter->params.rev < T3_REV_B2 && is_pcie(adapter); 3413 adapter->params.rev < T3_REV_B2 && is_pcie(adapter);
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index bcb5bc4e649b..eeb766aeced9 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -142,7 +142,7 @@ int t3_mac_reset(struct cmac *mac)
142 return 0; 142 return 0;
143} 143}
144 144
145int t3b2_mac_reset(struct cmac *mac) 145static int t3b2_mac_reset(struct cmac *mac)
146{ 146{
147 struct adapter *adap = mac->adapter; 147 struct adapter *adap = mac->adapter;
148 unsigned int oft = mac->offset; 148 unsigned int oft = mac->offset;