From: Vladimir Sokolovsky Date: Wed, 5 Nov 2014 12:31:20 +0000 (+0200) Subject: Use HAVE_PCIE_LINK_WIDTH X-Git-Tag: vofed-3.18~53 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=40f0d376048634b6ee0f1911eb87725a296b6e94;p=~emulex%2Ffor-vlad%2Fcompat.git Use HAVE_PCIE_LINK_WIDTH This is to avoid redefinition of 'enum pcie_link_width' on OSes that backport this enum. Signed-off-by: Vladimir Sokolovsky --- diff --git a/config/rdma.m4 b/config/rdma.m4 index d7d1ddb..2b4fdd7 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -447,7 +447,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], LB_LINUX_TRY_COMPILE([ #include ],[ - enum pcie_link_width *x; + enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN; return 0; ],[ diff --git a/include/linux/compat-3.12.h b/include/linux/compat-3.12.h index 36bb58e..cf4e55d 100644 --- a/include/linux/compat-3.12.h +++ b/include/linux/compat-3.12.h @@ -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)) */