Commit 8668ae92 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

qlge: fix sparse warnings

Fix sparse warnings and one bug:
    * Several routines can be static
    * Don't lose __iomem annotation
    * fix locking on error path (bug)
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25ed7849
...@@ -642,7 +642,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev) ...@@ -642,7 +642,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev)
} }
int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
{ {
int status = 0; int status = 0;
/* wait for reg to come ready */ /* wait for reg to come ready */
...@@ -832,7 +832,7 @@ end: ...@@ -832,7 +832,7 @@ end:
} }
/* Get the next large buffer. */ /* Get the next large buffer. */
struct bq_desc *ql_get_curr_lbuf(struct rx_ring *rx_ring) static struct bq_desc *ql_get_curr_lbuf(struct rx_ring *rx_ring)
{ {
struct bq_desc *lbq_desc = &rx_ring->lbq[rx_ring->lbq_curr_idx]; struct bq_desc *lbq_desc = &rx_ring->lbq[rx_ring->lbq_curr_idx];
rx_ring->lbq_curr_idx++; rx_ring->lbq_curr_idx++;
...@@ -843,7 +843,7 @@ struct bq_desc *ql_get_curr_lbuf(struct rx_ring *rx_ring) ...@@ -843,7 +843,7 @@ struct bq_desc *ql_get_curr_lbuf(struct rx_ring *rx_ring)
} }
/* Get the next small buffer. */ /* Get the next small buffer. */
struct bq_desc *ql_get_curr_sbuf(struct rx_ring *rx_ring) static struct bq_desc *ql_get_curr_sbuf(struct rx_ring *rx_ring)
{ {
struct bq_desc *sbq_desc = &rx_ring->sbq[rx_ring->sbq_curr_idx]; struct bq_desc *sbq_desc = &rx_ring->sbq[rx_ring->sbq_curr_idx];
rx_ring->sbq_curr_idx++; rx_ring->sbq_curr_idx++;
...@@ -1166,7 +1166,7 @@ map_error: ...@@ -1166,7 +1166,7 @@ map_error:
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
void ql_realign_skb(struct sk_buff *skb, int len) static void ql_realign_skb(struct sk_buff *skb, int len)
{ {
void *temp_addr = skb->data; void *temp_addr = skb->data;
...@@ -2069,7 +2069,7 @@ err: ...@@ -2069,7 +2069,7 @@ err:
return -ENOMEM; return -ENOMEM;
} }
void ql_free_lbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring) static void ql_free_lbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring)
{ {
int i; int i;
struct bq_desc *lbq_desc; struct bq_desc *lbq_desc;
...@@ -2132,7 +2132,7 @@ mem_error: ...@@ -2132,7 +2132,7 @@ mem_error:
return -ENOMEM; return -ENOMEM;
} }
void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring) static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring)
{ {
int i; int i;
struct bq_desc *sbq_desc; struct bq_desc *sbq_desc;
...@@ -2467,7 +2467,7 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) ...@@ -2467,7 +2467,7 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
rx_ring->sbq_base_indirect_dma = shadow_reg_dma; rx_ring->sbq_base_indirect_dma = shadow_reg_dma;
/* PCI doorbell mem area + 0x00 for consumer index register */ /* PCI doorbell mem area + 0x00 for consumer index register */
rx_ring->cnsmr_idx_db_reg = (u32 *) doorbell_area; rx_ring->cnsmr_idx_db_reg = (u32 __iomem *) doorbell_area;
rx_ring->cnsmr_idx = 0; rx_ring->cnsmr_idx = 0;
rx_ring->curr_entry = rx_ring->cq_base; rx_ring->curr_entry = rx_ring->cq_base;
...@@ -2475,10 +2475,10 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) ...@@ -2475,10 +2475,10 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
rx_ring->valid_db_reg = doorbell_area + 0x04; rx_ring->valid_db_reg = doorbell_area + 0x04;
/* PCI doorbell mem area + 0x18 for large buffer consumer */ /* PCI doorbell mem area + 0x18 for large buffer consumer */
rx_ring->lbq_prod_idx_db_reg = (u32 *) (doorbell_area + 0x18); rx_ring->lbq_prod_idx_db_reg = (u32 __iomem *) (doorbell_area + 0x18);
/* PCI doorbell mem area + 0x1c */ /* PCI doorbell mem area + 0x1c */
rx_ring->sbq_prod_idx_db_reg = (u32 *) (doorbell_area + 0x1c); rx_ring->sbq_prod_idx_db_reg = (u32 __iomem *) (doorbell_area + 0x1c);
memset((void *)cqicb, 0, sizeof(struct cqicb)); memset((void *)cqicb, 0, sizeof(struct cqicb));
cqicb->msix_vect = rx_ring->irq; cqicb->msix_vect = rx_ring->irq;
...@@ -2609,7 +2609,7 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring) ...@@ -2609,7 +2609,7 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring)
* Assign doorbell registers for this tx_ring. * Assign doorbell registers for this tx_ring.
*/ */
/* TX PCI doorbell mem area for tx producer index */ /* TX PCI doorbell mem area for tx producer index */
tx_ring->prod_idx_db_reg = (u32 *) doorbell_area; tx_ring->prod_idx_db_reg = (u32 __iomem *) doorbell_area;
tx_ring->prod_idx = 0; tx_ring->prod_idx = 0;
/* TX PCI doorbell mem area + 0x04 */ /* TX PCI doorbell mem area + 0x04 */
tx_ring->valid_db_reg = doorbell_area + 0x04; tx_ring->valid_db_reg = doorbell_area + 0x04;
...@@ -3520,6 +3520,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p) ...@@ -3520,6 +3520,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
{ {
struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev); struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
int ret = 0;
if (netif_running(ndev)) if (netif_running(ndev))
return -EBUSY; return -EBUSY;
...@@ -3532,11 +3533,11 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p) ...@@ -3532,11 +3533,11 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
if (ql_set_mac_addr_reg(qdev, (u8 *) ndev->dev_addr, if (ql_set_mac_addr_reg(qdev, (u8 *) ndev->dev_addr,
MAC_ADDR_TYPE_CAM_MAC, qdev->func)) {/* Unicast */ MAC_ADDR_TYPE_CAM_MAC, qdev->func)) {/* Unicast */
QPRINTK(qdev, HW, ERR, "Failed to load MAC address.\n"); QPRINTK(qdev, HW, ERR, "Failed to load MAC address.\n");
return -1; ret = -1;
} }
spin_unlock(&qdev->hw_lock); spin_unlock(&qdev->hw_lock);
return 0; return ret;
} }
static void qlge_tx_timeout(struct net_device *ndev) static void qlge_tx_timeout(struct net_device *ndev)
...@@ -3586,7 +3587,7 @@ static void ql_release_all(struct pci_dev *pdev) ...@@ -3586,7 +3587,7 @@ static void ql_release_all(struct pci_dev *pdev)
qdev->q_workqueue = NULL; qdev->q_workqueue = NULL;
} }
if (qdev->reg_base) if (qdev->reg_base)
iounmap((void *)qdev->reg_base); iounmap(qdev->reg_base);
if (qdev->doorbell_area) if (qdev->doorbell_area)
iounmap(qdev->doorbell_area); iounmap(qdev->doorbell_area);
pci_release_regions(pdev); pci_release_regions(pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment