]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
Use HAVE_PCIE_LINK_WIDTH
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Nov 2014 12:31:20 +0000 (14:31 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Nov 2014 12:31:20 +0000 (14:31 +0200)
This is to avoid redefinition of 'enum pcie_link_width' on OSes that
backport this enum.

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/rdma.m4
include/linux/compat-3.12.h

index d7d1ddb3e485f7937adf96f445497e7994c3da0f..2b4fdd7ceb987d0b440c517e55aa96f68c2f3f1b 100644 (file)
@@ -447,7 +447,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        LB_LINUX_TRY_COMPILE([
                #include <linux/pci.h>
        ],[
-               enum pcie_link_width *x;
+               enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
 
                return 0;
        ],[
index 36bb58ea51fd3228569eccc9d3ad76dc4ccd68ff..cf4e55d14709ad987bd94c44b5d4945ec6191244 100644 (file)
@@ -21,6 +21,7 @@ static inline struct inode *file_inode(struct file *f)
 int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
                enum pcie_link_width *width);
 
+#ifndef HAVE_PCIE_LINK_WIDTH
 /* These values come from the PCI Express Spec */
 enum pcie_link_width {
        PCIE_LNK_WIDTH_RESRV    = 0x00,
@@ -33,6 +34,7 @@ enum pcie_link_width {
        PCIE_LNK_X32            = 0x20,
        PCIE_LNK_WIDTH_UNKNOWN  = 0xFF,
 };
+#endif
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) */