aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-29 06:39:13 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-29 23:33:39 -0500
commit57e7c8cef224af166b8ec932b5e383641418c005 (patch)
tree78680efec58123f12cccd9f91a2f0314d98ae606
parent1f820f538f7396db7fd40684b9c3620816acc5a3 (diff)
net: vxge: avoid unused function warnings
When CONFIG_PCI_MSI is disabled, we get warnings about unused functions in the vxge driver: drivers/net/ethernet/neterion/vxge/vxge-main.c:2121:13: warning: 'adaptive_coalesce_tx_interrupts' defined but not used [-Wunused-function] drivers/net/ethernet/neterion/vxge/vxge-main.c:2149:13: warning: 'adaptive_coalesce_rx_interrupts' defined but not used [-Wunused-function] We could add another #ifdef here, but it's nicer to avoid those warnings for good by converting the existing #ifdef to if(IS_ENABLED()), which has the same effect but provides better compile-time coverage in general, and lets the compiler understand better when the function is intentionally unused. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index 50d5604833ed..e0993eba5df3 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -2223,8 +2223,6 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id)
2223 return IRQ_NONE; 2223 return IRQ_NONE;
2224} 2224}
2225 2225
2226#ifdef CONFIG_PCI_MSI
2227
2228static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id) 2226static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id)
2229{ 2227{
2230 struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id; 2228 struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id;
@@ -2442,16 +2440,13 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev)
2442 if (vdev->config.intr_type == MSI_X) 2440 if (vdev->config.intr_type == MSI_X)
2443 pci_disable_msix(vdev->pdev); 2441 pci_disable_msix(vdev->pdev);
2444} 2442}
2445#endif
2446 2443
2447static void vxge_rem_isr(struct vxgedev *vdev) 2444static void vxge_rem_isr(struct vxgedev *vdev)
2448{ 2445{
2449#ifdef CONFIG_PCI_MSI 2446 if (IS_ENABLED(CONFIG_PCI_MSI) &&
2450 if (vdev->config.intr_type == MSI_X) { 2447 vdev->config.intr_type == MSI_X) {
2451 vxge_rem_msix_isr(vdev); 2448 vxge_rem_msix_isr(vdev);
2452 } else 2449 } else if (vdev->config.intr_type == INTA) {
2453#endif
2454 if (vdev->config.intr_type == INTA) {
2455 synchronize_irq(vdev->pdev->irq); 2450 synchronize_irq(vdev->pdev->irq);
2456 free_irq(vdev->pdev->irq, vdev); 2451 free_irq(vdev->pdev->irq, vdev);
2457 } 2452 }
@@ -2460,11 +2455,10 @@ static void vxge_rem_isr(struct vxgedev *vdev)
2460static int vxge_add_isr(struct vxgedev *vdev) 2455static int vxge_add_isr(struct vxgedev *vdev)
2461{ 2456{
2462 int ret = 0; 2457 int ret = 0;
2463#ifdef CONFIG_PCI_MSI
2464 int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; 2458 int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0;
2465 int pci_fun = PCI_FUNC(vdev->pdev->devfn); 2459 int pci_fun = PCI_FUNC(vdev->pdev->devfn);
2466 2460
2467 if (vdev->config.intr_type == MSI_X) 2461 if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X)
2468 ret = vxge_enable_msix(vdev); 2462 ret = vxge_enable_msix(vdev);
2469 2463
2470 if (ret) { 2464 if (ret) {
@@ -2475,7 +2469,7 @@ static int vxge_add_isr(struct vxgedev *vdev)
2475 vdev->config.intr_type = INTA; 2469 vdev->config.intr_type = INTA;
2476 } 2470 }
2477 2471
2478 if (vdev->config.intr_type == MSI_X) { 2472 if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) {
2479 for (intr_idx = 0; 2473 for (intr_idx = 0;
2480 intr_idx < (vdev->no_of_vpath * 2474 intr_idx < (vdev->no_of_vpath *
2481 VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) { 2475 VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) {
@@ -2576,9 +2570,8 @@ static int vxge_add_isr(struct vxgedev *vdev)
2576 vdev->vxge_entries[intr_cnt].in_use = 1; 2570 vdev->vxge_entries[intr_cnt].in_use = 1;
2577 vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; 2571 vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0];
2578 } 2572 }
2579INTA_MODE:
2580#endif
2581 2573
2574INTA_MODE:
2582 if (vdev->config.intr_type == INTA) { 2575 if (vdev->config.intr_type == INTA) {
2583 snprintf(vdev->desc[0], VXGE_INTR_STRLEN, 2576 snprintf(vdev->desc[0], VXGE_INTR_STRLEN,
2584 "%s:vxge:INTA", vdev->ndev->name); 2577 "%s:vxge:INTA", vdev->ndev->name);
@@ -3889,12 +3882,12 @@ static void vxge_device_config_init(struct vxge_hw_device_config *device_config,
3889 if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT) 3882 if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT)
3890 max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT; 3883 max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT;
3891 3884
3892#ifndef CONFIG_PCI_MSI 3885 if (!IS_ENABLED(CONFIG_PCI_MSI)) {
3893 vxge_debug_init(VXGE_ERR, 3886 vxge_debug_init(VXGE_ERR,
3894 "%s: This Kernel does not support " 3887 "%s: This Kernel does not support "
3895 "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); 3888 "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME);
3896 *intr_type = INTA; 3889 *intr_type = INTA;
3897#endif 3890 }
3898 3891
3899 /* Configure whether MSI-X or IRQL. */ 3892 /* Configure whether MSI-X or IRQL. */
3900 switch (*intr_type) { 3893 switch (*intr_type) {