bna: scope and dead code cleanup

As suggested by Stephen Hemminger:
1) Made functions and data structures static wherever possible.
2) Removed unused code.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 7210c34..74c64d6 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -28,7 +28,7 @@
 #include "bna.h"
 #include "cna.h"
 
-DEFINE_MUTEX(bnad_fwimg_mutex);
+static DEFINE_MUTEX(bnad_fwimg_mutex);
 
 /*
  * Module params
@@ -46,7 +46,7 @@
  */
 u32 bnad_rxqs_per_cq = 2;
 
-const u8 bnad_bcast_addr[] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+static const u8 bnad_bcast_addr[] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
 /*
  * Local MACROS
@@ -687,7 +687,7 @@
  * Called with bnad->bna_lock held b'cos of
  * bnad->cfg_flags access.
  */
-void
+static void
 bnad_disable_mbox_irq(struct bnad *bnad)
 {
 	int irq = BNAD_GET_MBOX_IRQ(bnad);
@@ -956,11 +956,6 @@
 		  jiffies + msecs_to_jiffies(BNAD_STATS_TIMER_FREQ));
 }
 
-void
-bnad_cb_stats_clr(struct bnad *bnad)
-{
-}
-
 /* Resource allocation, free functions */
 
 static void
@@ -1111,8 +1106,10 @@
 	}
 
 	spin_lock_irqsave(&bnad->bna_lock, flags);
+
 	if (bnad->cfg_flags & BNAD_CF_MSIX)
 		disable_irq_nosync(irq);
+
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 	return 0;
 }
@@ -2243,7 +2240,6 @@
 bnad_enable_msix(struct bnad *bnad)
 {
 	int i, ret;
-	u32 tot_msix_num;
 	unsigned long flags;
 
 	spin_lock_irqsave(&bnad->bna_lock, flags);
@@ -2256,18 +2252,16 @@
 	if (bnad->msix_table)
 		return;
 
-	tot_msix_num = bnad->msix_num + bnad->msix_diag_num;
-
 	bnad->msix_table =
-		kcalloc(tot_msix_num, sizeof(struct msix_entry), GFP_KERNEL);
+		kcalloc(bnad->msix_num, sizeof(struct msix_entry), GFP_KERNEL);
 
 	if (!bnad->msix_table)
 		goto intx_mode;
 
-	for (i = 0; i < tot_msix_num; i++)
+	for (i = 0; i < bnad->msix_num; i++)
 		bnad->msix_table[i].entry = i;
 
-	ret = pci_enable_msix(bnad->pcidev, bnad->msix_table, tot_msix_num);
+	ret = pci_enable_msix(bnad->pcidev, bnad->msix_table, bnad->msix_num);
 	if (ret > 0) {
 		/* Not enough MSI-X vectors. */
 
@@ -2280,12 +2274,11 @@
 			+ (bnad->num_rx
 			* bnad->num_rxp_per_rx) +
 			 BNAD_MAILBOX_MSIX_VECTORS;
-		tot_msix_num = bnad->msix_num + bnad->msix_diag_num;
 
 		/* Try once more with adjusted numbers */
 		/* If this fails, fall back to INTx */
 		ret = pci_enable_msix(bnad->pcidev, bnad->msix_table,
-				      tot_msix_num);
+				      bnad->msix_num);
 		if (ret)
 			goto intx_mode;
 
@@ -2298,7 +2291,6 @@
 	kfree(bnad->msix_table);
 	bnad->msix_table = NULL;
 	bnad->msix_num = 0;
-	bnad->msix_diag_num = 0;
 	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bnad->cfg_flags &= ~BNAD_CF_MSIX;
 	bnad_q_num_init(bnad);
@@ -2946,7 +2938,6 @@
 	bnad->msix_num = (bnad->num_tx * bnad->num_txq_per_tx) +
 		(bnad->num_rx * bnad->num_rxp_per_rx) +
 			 BNAD_MAILBOX_MSIX_VECTORS;
-	bnad->msix_diag_num = 2;	/* 1 for Tx, 1 for Rx */
 
 	bnad->txq_depth = BNAD_TXQ_DEPTH;
 	bnad->rxq_depth = BNAD_RXQ_DEPTH;
@@ -3217,7 +3208,7 @@
 	free_netdev(netdev);
 }
 
-const struct pci_device_id bnad_pci_id_table[] = {
+static const struct pci_device_id bnad_pci_id_table[] = {
 	{
 		PCI_DEVICE(PCI_VENDOR_ID_BROCADE,
 			PCI_DEVICE_ID_BROCADE_CT),