Patch "net: vxge: avoid unused function warnings" has been added to the 3.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: vxge: avoid unused function warnings

to the 3.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-vxge-avoid-unused-function-warnings.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 57e7c8cef224af166b8ec932b5e383641418c005 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Fri, 29 Jan 2016 12:39:13 +0100
Subject: net: vxge: avoid unused function warnings

From: Arnd Bergmann <arnd@xxxxxxxx>

commit 57e7c8cef224af166b8ec932b5e383641418c005 upstream.

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@xxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/net/ethernet/neterion/vxge/vxge-main.c |   31 +++++++++----------------
 1 file changed, 12 insertions(+), 19 deletions(-)

--- 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
 	return IRQ_NONE;
 }
 
-#ifdef CONFIG_PCI_MSI
-
 static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id)
 {
 	struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id;
@@ -2442,16 +2440,13 @@ static void vxge_rem_msix_isr(struct vxg
 	if (vdev->config.intr_type == MSI_X)
 		pci_disable_msix(vdev->pdev);
 }
-#endif
 
 static void vxge_rem_isr(struct vxgedev *vdev)
 {
-#ifdef CONFIG_PCI_MSI
-	if (vdev->config.intr_type == MSI_X) {
+	if (IS_ENABLED(CONFIG_PCI_MSI) &&
+	    vdev->config.intr_type == MSI_X) {
 		vxge_rem_msix_isr(vdev);
-	} else
-#endif
-	if (vdev->config.intr_type == INTA) {
+	} else if (vdev->config.intr_type == INTA) {
 			synchronize_irq(vdev->pdev->irq);
 			free_irq(vdev->pdev->irq, vdev);
 	}
@@ -2460,11 +2455,10 @@ static void vxge_rem_isr(struct vxgedev
 static int vxge_add_isr(struct vxgedev *vdev)
 {
 	int ret = 0;
-#ifdef CONFIG_PCI_MSI
 	int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0;
 	int pci_fun = PCI_FUNC(vdev->pdev->devfn);
 
-	if (vdev->config.intr_type == MSI_X)
+	if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X)
 		ret = vxge_enable_msix(vdev);
 
 	if (ret) {
@@ -2475,7 +2469,7 @@ static int vxge_add_isr(struct vxgedev *
 		vdev->config.intr_type = INTA;
 	}
 
-	if (vdev->config.intr_type == MSI_X) {
+	if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) {
 		for (intr_idx = 0;
 		     intr_idx < (vdev->no_of_vpath *
 			VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) {
@@ -2576,9 +2570,8 @@ static int vxge_add_isr(struct vxgedev *
 		vdev->vxge_entries[intr_cnt].in_use = 1;
 		vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0];
 	}
-INTA_MODE:
-#endif
 
+INTA_MODE:
 	if (vdev->config.intr_type == INTA) {
 		snprintf(vdev->desc[0], VXGE_INTR_STRLEN,
 			"%s:vxge:INTA", vdev->ndev->name);
@@ -3889,12 +3882,12 @@ static void vxge_device_config_init(stru
 	if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT)
 		max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT;
 
-#ifndef CONFIG_PCI_MSI
-	vxge_debug_init(VXGE_ERR,
-		"%s: This Kernel does not support "
-		"MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME);
-	*intr_type = INTA;
-#endif
+	if (!IS_ENABLED(CONFIG_PCI_MSI)) {
+		vxge_debug_init(VXGE_ERR,
+			"%s: This Kernel does not support "
+			"MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME);
+		*intr_type = INTA;
+	}
 
 	/* Configure whether MSI-X or IRQL. */
 	switch (*intr_type) {


Patches currently in stable-queue which might be from arnd@xxxxxxxx are

queue-3.18/net-vxge-avoid-unused-function-warnings.patch
queue-3.18/tty-nozomi-avoid-a-harmless-gcc-warning.patch
queue-3.18/perf-avoid-horrible-stack-usage.patch
queue-3.18/btrfs-fix-state-private-cast-on-32-bit-machines.patch
queue-3.18/mm-init-fix-zone-boundary-creation.patch
queue-3.18/iommu-vt-d-remove-unused-variable.patch
queue-3.18/mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch
queue-3.18/net-tulip-turn-compile-time-warning-into-dev_warn.patch
queue-3.18/nfsd-work-around-a-gcc-5.1-warning.patch
queue-3.18/fs-nfs-fix-new-compiler-warning-about-boolean-in-switch.patch
queue-3.18/aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch
queue-3.18/mmc-sunxi-avoid-invalid-pointer-calculation.patch
queue-3.18/acpi-power-avoid-maybe-uninitialized-warning.patch
queue-3.18/gfs2-avoid-uninitialized-variable-warning.patch
queue-3.18/gadgetfs-fix-uninitialized-variable-in-error-handling.patch
queue-3.18/arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch
queue-3.18/brcmfmac-avoid-gcc-5.1-warning.patch
queue-3.18/kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch
queue-3.18/net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch
queue-3.18/clk-at91-usb-fix-determine_rate-prototype-again.patch
queue-3.18/mips-ralink-cosmetic-change-to-prom_init.patch
queue-3.18/mips-fix-the-build-on-jz4740-after-removing-the-custom-gpio.h.patch
queue-3.18/mips-asm-compiler-add-new-macros-to-set-isa-and-arch-asm-annotations.patch
queue-3.18/misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch
queue-3.18/hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch
queue-3.18/dm-bufio-hide-bogus-warning.patch
queue-3.18/fix-signed-unsigned-pointer-warning.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]