diff options
author | Vipul Pandya <vipul@chelsio.com> | 2012-10-07 22:59:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-08 14:46:35 -0400 |
commit | 404d9e3fc322023619cf0a9c5c6efbbaf7e14ee8 (patch) | |
tree | c588e6efbb5a57e34dfd01e28513a9c9de87599b | |
parent | ee9a8f7ab2edf801b8b514c310455c94acc232f6 (diff) |
cxgb4: Address various sparse warnings
This patch fixes type assignment issues, function definition and symbol
shadowing which triggered sparse warnings.
Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 54 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 13 |
3 files changed, 39 insertions, 29 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 31752b24434e..a4da893ac1e1 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | |||
@@ -696,6 +696,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool enable); | |||
696 | int get_vpd_params(struct adapter *adapter, struct vpd_params *p); | 696 | int get_vpd_params(struct adapter *adapter, struct vpd_params *p); |
697 | int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); | 697 | int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); |
698 | unsigned int t4_flash_cfg_addr(struct adapter *adapter); | 698 | unsigned int t4_flash_cfg_addr(struct adapter *adapter); |
699 | int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); | ||
699 | int t4_check_fw_version(struct adapter *adapter); | 700 | int t4_check_fw_version(struct adapter *adapter); |
700 | int t4_prep_adapter(struct adapter *adapter); | 701 | int t4_prep_adapter(struct adapter *adapter); |
701 | int t4_port_init(struct adapter *adap, int mbox, int pf, int vf); | 702 | int t4_port_init(struct adapter *adap, int mbox, int pf, int vf); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 6b9f6bb2f7ed..604f4f87f550 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -443,7 +443,10 @@ int dbfifo_int_thresh = 10; /* 10 == 640 entry threshold */ | |||
443 | module_param(dbfifo_int_thresh, int, 0644); | 443 | module_param(dbfifo_int_thresh, int, 0644); |
444 | MODULE_PARM_DESC(dbfifo_int_thresh, "doorbell fifo interrupt threshold"); | 444 | MODULE_PARM_DESC(dbfifo_int_thresh, "doorbell fifo interrupt threshold"); |
445 | 445 | ||
446 | int dbfifo_drain_delay = 1000; /* usecs to sleep while draining the dbfifo */ | 446 | /* |
447 | * usecs to sleep while draining the dbfifo | ||
448 | */ | ||
449 | static int dbfifo_drain_delay = 1000; | ||
447 | module_param(dbfifo_drain_delay, int, 0644); | 450 | module_param(dbfifo_drain_delay, int, 0644); |
448 | MODULE_PARM_DESC(dbfifo_drain_delay, | 451 | MODULE_PARM_DESC(dbfifo_drain_delay, |
449 | "usecs to sleep while draining the dbfifo"); | 452 | "usecs to sleep while draining the dbfifo"); |
@@ -636,7 +639,7 @@ static void name_msix_vecs(struct adapter *adap) | |||
636 | static int request_msix_queue_irqs(struct adapter *adap) | 639 | static int request_msix_queue_irqs(struct adapter *adap) |
637 | { | 640 | { |
638 | struct sge *s = &adap->sge; | 641 | struct sge *s = &adap->sge; |
639 | int err, ethqidx, ofldqidx = 0, rdmaqidx = 0, msi = 2; | 642 | int err, ethqidx, ofldqidx = 0, rdmaqidx = 0, msi_index = 2; |
640 | 643 | ||
641 | err = request_irq(adap->msix_info[1].vec, t4_sge_intr_msix, 0, | 644 | err = request_irq(adap->msix_info[1].vec, t4_sge_intr_msix, 0, |
642 | adap->msix_info[1].desc, &s->fw_evtq); | 645 | adap->msix_info[1].desc, &s->fw_evtq); |
@@ -644,56 +647,60 @@ static int request_msix_queue_irqs(struct adapter *adap) | |||
644 | return err; | 647 | return err; |
645 | 648 | ||
646 | for_each_ethrxq(s, ethqidx) { | 649 | for_each_ethrxq(s, ethqidx) { |
647 | err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0, | 650 | err = request_irq(adap->msix_info[msi_index].vec, |
648 | adap->msix_info[msi].desc, | 651 | t4_sge_intr_msix, 0, |
652 | adap->msix_info[msi_index].desc, | ||
649 | &s->ethrxq[ethqidx].rspq); | 653 | &s->ethrxq[ethqidx].rspq); |
650 | if (err) | 654 | if (err) |
651 | goto unwind; | 655 | goto unwind; |
652 | msi++; | 656 | msi_index++; |
653 | } | 657 | } |
654 | for_each_ofldrxq(s, ofldqidx) { | 658 | for_each_ofldrxq(s, ofldqidx) { |
655 | err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0, | 659 | err = request_irq(adap->msix_info[msi_index].vec, |
656 | adap->msix_info[msi].desc, | 660 | t4_sge_intr_msix, 0, |
661 | adap->msix_info[msi_index].desc, | ||
657 | &s->ofldrxq[ofldqidx].rspq); | 662 | &s->ofldrxq[ofldqidx].rspq); |
658 | if (err) | 663 | if (err) |
659 | goto unwind; | 664 | goto unwind; |
660 | msi++; | 665 | msi_index++; |
661 | } | 666 | } |
662 | for_each_rdmarxq(s, rdmaqidx) { | 667 | for_each_rdmarxq(s, rdmaqidx) { |
663 | err = request_irq(adap->msix_info[msi].vec, t4_sge_intr_msix, 0, | 668 | err = request_irq(adap->msix_info[msi_index].vec, |
664 | adap->msix_info[msi].desc, | 669 | t4_sge_intr_msix, 0, |
670 | adap->msix_info[msi_index].desc, | ||
665 | &s->rdmarxq[rdmaqidx].rspq); | 671 | &s->rdmarxq[rdmaqidx].rspq); |
666 | if (err) | 672 | if (err) |
667 | goto unwind; | 673 | goto unwind; |
668 | msi++; | 674 | msi_index++; |
669 | } | 675 | } |
670 | return 0; | 676 | return 0; |
671 | 677 | ||
672 | unwind: | 678 | unwind: |
673 | while (--rdmaqidx >= 0) | 679 | while (--rdmaqidx >= 0) |
674 | free_irq(adap->msix_info[--msi].vec, | 680 | free_irq(adap->msix_info[--msi_index].vec, |
675 | &s->rdmarxq[rdmaqidx].rspq); | 681 | &s->rdmarxq[rdmaqidx].rspq); |
676 | while (--ofldqidx >= 0) | 682 | while (--ofldqidx >= 0) |
677 | free_irq(adap->msix_info[--msi].vec, | 683 | free_irq(adap->msix_info[--msi_index].vec, |
678 | &s->ofldrxq[ofldqidx].rspq); | 684 | &s->ofldrxq[ofldqidx].rspq); |
679 | while (--ethqidx >= 0) | 685 | while (--ethqidx >= 0) |
680 | free_irq(adap->msix_info[--msi].vec, &s->ethrxq[ethqidx].rspq); | 686 | free_irq(adap->msix_info[--msi_index].vec, |
687 | &s->ethrxq[ethqidx].rspq); | ||
681 | free_irq(adap->msix_info[1].vec, &s->fw_evtq); | 688 | free_irq(adap->msix_info[1].vec, &s->fw_evtq); |
682 | return err; | 689 | return err; |
683 | } | 690 | } |
684 | 691 | ||
685 | static void free_msix_queue_irqs(struct adapter *adap) | 692 | static void free_msix_queue_irqs(struct adapter *adap) |
686 | { | 693 | { |
687 | int i, msi = 2; | 694 | int i, msi_index = 2; |
688 | struct sge *s = &adap->sge; | 695 | struct sge *s = &adap->sge; |
689 | 696 | ||
690 | free_irq(adap->msix_info[1].vec, &s->fw_evtq); | 697 | free_irq(adap->msix_info[1].vec, &s->fw_evtq); |
691 | for_each_ethrxq(s, i) | 698 | for_each_ethrxq(s, i) |
692 | free_irq(adap->msix_info[msi++].vec, &s->ethrxq[i].rspq); | 699 | free_irq(adap->msix_info[msi_index++].vec, &s->ethrxq[i].rspq); |
693 | for_each_ofldrxq(s, i) | 700 | for_each_ofldrxq(s, i) |
694 | free_irq(adap->msix_info[msi++].vec, &s->ofldrxq[i].rspq); | 701 | free_irq(adap->msix_info[msi_index++].vec, &s->ofldrxq[i].rspq); |
695 | for_each_rdmarxq(s, i) | 702 | for_each_rdmarxq(s, i) |
696 | free_irq(adap->msix_info[msi++].vec, &s->rdmarxq[i].rspq); | 703 | free_irq(adap->msix_info[msi_index++].vec, &s->rdmarxq[i].rspq); |
697 | } | 704 | } |
698 | 705 | ||
699 | /** | 706 | /** |
@@ -2535,9 +2542,8 @@ static int read_eq_indices(struct adapter *adap, u16 qid, u16 *pidx, u16 *cidx) | |||
2535 | 2542 | ||
2536 | ret = t4_mem_win_read_len(adap, addr, (__be32 *)&indices, 8); | 2543 | ret = t4_mem_win_read_len(adap, addr, (__be32 *)&indices, 8); |
2537 | if (!ret) { | 2544 | if (!ret) { |
2538 | indices = be64_to_cpu(indices); | 2545 | *cidx = (be64_to_cpu(indices) >> 25) & 0xffff; |
2539 | *cidx = (indices >> 25) & 0xffff; | 2546 | *pidx = (be64_to_cpu(indices) >> 9) & 0xffff; |
2540 | *pidx = (indices >> 9) & 0xffff; | ||
2541 | } | 2547 | } |
2542 | return ret; | 2548 | return ret; |
2543 | } | 2549 | } |
@@ -3634,10 +3640,10 @@ static int adap_init0_no_config(struct adapter *adapter, int reset) | |||
3634 | * field selections will fit in the 36-bit budget. | 3640 | * field selections will fit in the 36-bit budget. |
3635 | */ | 3641 | */ |
3636 | if (tp_vlan_pri_map != TP_VLAN_PRI_MAP_DEFAULT) { | 3642 | if (tp_vlan_pri_map != TP_VLAN_PRI_MAP_DEFAULT) { |
3637 | int i, bits = 0; | 3643 | int j, bits = 0; |
3638 | 3644 | ||
3639 | for (i = TP_VLAN_PRI_MAP_FIRST; i <= TP_VLAN_PRI_MAP_LAST; i++) | 3645 | for (j = TP_VLAN_PRI_MAP_FIRST; j <= TP_VLAN_PRI_MAP_LAST; j++) |
3640 | switch (tp_vlan_pri_map & (1 << i)) { | 3646 | switch (tp_vlan_pri_map & (1 << j)) { |
3641 | case 0: | 3647 | case 0: |
3642 | /* compressed filter field not enabled */ | 3648 | /* compressed filter field not enabled */ |
3643 | break; | 3649 | break; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index e914c4113b8d..32eec15fe4c2 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | |||
@@ -380,9 +380,11 @@ static int t4_mem_win_rw(struct adapter *adap, u32 addr, __be32 *data, int dir) | |||
380 | /* Collecting data 4 bytes at a time upto MEMWIN0_APERTURE */ | 380 | /* Collecting data 4 bytes at a time upto MEMWIN0_APERTURE */ |
381 | for (i = 0; i < MEMWIN0_APERTURE; i = i+0x4) { | 381 | for (i = 0; i < MEMWIN0_APERTURE; i = i+0x4) { |
382 | if (dir) | 382 | if (dir) |
383 | *data++ = t4_read_reg(adap, (MEMWIN0_BASE + i)); | 383 | *data++ = (__force __be32) t4_read_reg(adap, |
384 | (MEMWIN0_BASE + i)); | ||
384 | else | 385 | else |
385 | t4_write_reg(adap, (MEMWIN0_BASE + i), *data++); | 386 | t4_write_reg(adap, (MEMWIN0_BASE + i), |
387 | (__force u32) *data++); | ||
386 | } | 388 | } |
387 | 389 | ||
388 | return 0; | 390 | return 0; |
@@ -744,7 +746,7 @@ static int t4_read_flash(struct adapter *adapter, unsigned int addr, | |||
744 | if (ret) | 746 | if (ret) |
745 | return ret; | 747 | return ret; |
746 | if (byte_oriented) | 748 | if (byte_oriented) |
747 | *data = htonl(*data); | 749 | *data = (__force __u32) (htonl(*data)); |
748 | } | 750 | } |
749 | return 0; | 751 | return 0; |
750 | } | 752 | } |
@@ -992,7 +994,7 @@ int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size) | |||
992 | int ret, addr; | 994 | int ret, addr; |
993 | unsigned int i; | 995 | unsigned int i; |
994 | u8 first_page[SF_PAGE_SIZE]; | 996 | u8 first_page[SF_PAGE_SIZE]; |
995 | const u32 *p = (const u32 *)fw_data; | 997 | const __be32 *p = (const __be32 *)fw_data; |
996 | const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data; | 998 | const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data; |
997 | unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; | 999 | unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; |
998 | unsigned int fw_img_start = adap->params.sf_fw_start; | 1000 | unsigned int fw_img_start = adap->params.sf_fw_start; |
@@ -2315,7 +2317,8 @@ int t4_mem_win_read_len(struct adapter *adap, u32 addr, __be32 *data, int len) | |||
2315 | t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET); | 2317 | t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET); |
2316 | 2318 | ||
2317 | for (i = 0; i < len; i += 4) | 2319 | for (i = 0; i < len; i += 4) |
2318 | *data++ = t4_read_reg(adap, (MEMWIN0_BASE + off + i)); | 2320 | *data++ = (__force __be32) t4_read_reg(adap, |
2321 | (MEMWIN0_BASE + off + i)); | ||
2319 | 2322 | ||
2320 | return 0; | 2323 | return 0; |
2321 | } | 2324 | } |