diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2014-04-28 15:12:15 +0200 | 
|---|---|---|
| committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-05-01 18:44:14 -0700 | 
| commit | 025224348edb16420e17fb6e3a6249f94d39d3eb (patch) | |
| tree | cba1bc0690c32b9b80f7c33b32952366db993479 /backport/backport-include/linux | |
| parent | 496e84582c785e404849ae75218a7adbae53a416 (diff) | |
backports: remove more old ifdef/compat code
Since support for kernels < 3.0 was removed, there's now a bunch
of dead code that can be removed - do it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'backport/backport-include/linux')
| -rw-r--r-- | backport/backport-include/linux/device.h | 16 | ||||
| -rw-r--r-- | backport/backport-include/linux/mmc/host.h | 11 | ||||
| -rw-r--r-- | backport/backport-include/linux/netdev_features.h | 4 | ||||
| -rw-r--r-- | backport/backport-include/linux/netdevice.h | 11 | ||||
| -rw-r--r-- | backport/backport-include/linux/pci.h | 102 | ||||
| -rw-r--r-- | backport/backport-include/linux/rcupdate.h | 7 | 
6 files changed, 1 insertions, 150 deletions
| diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index d6226abb..3403896d 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -124,19 +124,11 @@ static void init_##_name##_attrs(void)				\  }  #ifndef __ATTRIBUTE_GROUPS -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))  #define __ATTRIBUTE_GROUPS(_name)				\  static const struct attribute_group *_name##_groups[] = {	\  	&_name##_group,						\  	NULL,							\  } -#else -#define __ATTRIBUTE_GROUPS(_name)				\ -static struct attribute_group *_name##_groups[] = {		\ -	&_name##_group,						\ -	NULL,							\ -} -#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) */  #endif /* __ATTRIBUTE_GROUPS */  #undef ATTRIBUTE_GROUPS @@ -147,14 +139,6 @@ static const struct attribute_group _name##_group = {		\  static inline void init_##_name##_attrs(void) {}		\  __ATTRIBUTE_GROUPS(_name) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) -#define dev_get_platdata LINUX_BACKPORT(dev_get_platdata) -static inline void *dev_get_platdata(const struct device *dev) -{ -	return dev->platform_data; -} -#endif -  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)  #define devm_kmalloc(dev, size, flags) devm_kzalloc(dev, size, flags)   #endif diff --git a/backport/backport-include/linux/mmc/host.h b/backport/backport-include/linux/mmc/host.h deleted file mode 100644 index 49ca5c21..00000000 --- a/backport/backport-include/linux/mmc/host.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __BACKPORT_MMC_HOST_H -#define __BACKPORT_MMC_HOST_H -#include <linux/version.h> -#include_next <linux/mmc/host.h> - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) -/* rename member in struct mmc_host */ -#define max_segs	max_hw_segs -#endif - -#endif /* __BACKPORT_MMC_HOST_H */ diff --git a/backport/backport-include/linux/netdev_features.h b/backport/backport-include/linux/netdev_features.h index 76fb4639..350283d6 100644 --- a/backport/backport-include/linux/netdev_features.h +++ b/backport/backport-include/linux/netdev_features.h @@ -8,15 +8,11 @@  #include <linux/types.h>  /* added via 9356b8fc */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)  #define NETIF_F_HW_VLAN_CTAG_RX			NETIF_F_HW_VLAN_RX  #define NETIF_F_HW_VLAN_CTAG_TX			NETIF_F_HW_VLAN_TX -#endif  /* added via d314774c */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)  #define NETIF_F_HW_VLAN_CTAG_FILTER		NETIF_F_HW_VLAN_FILTER -#endif  /* c8f44aff made this u32 but later a861a8b2 changed it to u64 both on v3.3 */  typedef u32 netdev_features_t; diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 04b310db..2abb47d7 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -82,17 +82,6 @@ static inline void dev_consume_skb_any(struct sk_buff *skb)  }  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) */ -/* d1c76af9e */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) -enum { /* backport: provide the enum name already */ -	GRO_MERGED, -	GRO_MERGED_FREE, -	GRO_HELD, -	GRO_NORMAL, -	GRO_DROP, -}; -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ -  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,8)  #define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops)  extern void netdev_set_default_ethtool_ops(struct net_device *dev, diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h index e438f143..3dd2c7e4 100644 --- a/backport/backport-include/linux/pci.h +++ b/backport/backport-include/linux/pci.h @@ -3,73 +3,6 @@  #include_next <linux/pci.h>  #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) -#define compat_pci_suspend(fn)						\ -	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\ -	{								\ -		int r;							\ -									\ -		r = fn(&pdev->dev);					\ -		if (r)							\ -			return r;					\ -									\ -		pci_save_state(pdev);					\ -		pci_disable_device(pdev);				\ -		pci_set_power_state(pdev, PCI_D3hot);			\ -									\ -		return 0;						\ -	} - -#define compat_pci_resume(fn)						\ -	int fn##_compat(struct pci_dev *pdev)				\ -	{								\ -		int r;							\ -									\ -		pci_set_power_state(pdev, PCI_D0);			\ -		r = pci_enable_device(pdev);				\ -		if (r)							\ -			return r;					\ -		pci_restore_state(pdev);				\ -									\ -		return fn(&pdev->dev);					\ -	} -#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29) -#define compat_pci_suspend(fn)						\ -	int fn##_compat(struct device *dev)			 	\ -	{								\ -		struct pci_dev *pdev = to_pci_dev(dev);			\ -		int r;							\ -									\ -		r = fn(&pdev->dev);					\ -		if (r)							\ -			return r;					\ -									\ -		pci_save_state(pdev);					\ -		pci_disable_device(pdev);				\ -		pci_set_power_state(pdev, PCI_D3hot);			\ -									\ -		return 0;						\ -	} - -#define compat_pci_resume(fn)						\ -	int fn##_compat(struct device *dev)				\ -	{								\ -		struct pci_dev *pdev = to_pci_dev(dev);			\ -		int r;							\ -									\ -		pci_set_power_state(pdev, PCI_D0);			\ -		r = pci_enable_device(pdev);				\ -		if (r)							\ -			return r;					\ -		pci_restore_state(pdev);				\ -									\ -		return fn(&pdev->dev);					\ -	} -#else -#define compat_pci_suspend(fn) -#define compat_pci_resume(fn) -#endif -  #ifndef module_pci_driver  /**   * module_pci_driver() - Helper macro for registering a PCI driver @@ -129,39 +62,6 @@ static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos,  }  #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) -/* mask pci_pcie_cap as debian squeeze also backports this */ -#define pci_pcie_cap LINUX_BACKPORT(pci_pcie_cap) -static inline int pci_pcie_cap(struct pci_dev *dev) -{ -	return pci_find_capability(dev, PCI_CAP_ID_EXP); -} - -/* mask pci_is_pcie as RHEL6 backports this */ -#define pci_is_pcie LINUX_BACKPORT(pci_is_pcie) -static inline bool pci_is_pcie(struct pci_dev *dev) -{ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) -	return dev->is_pcie; -#else -	return !!pci_pcie_cap(dev); -#endif -} -#endif /* < 2.6.33 */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) -#define pci_ioremap_bar LINUX_BACKPORT(pci_ioremap_bar) -void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); - -#define pci_wake_from_d3 LINUX_BACKPORT(pci_wake_from_d3) -int pci_wake_from_d3(struct pci_dev *dev, bool enable); -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -#define pci_pme_capable LINUX_BACKPORT(pci_pme_capable) -bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); -#endif -  #ifndef PCI_DEVICE_SUB  /**   * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem @@ -234,7 +134,7 @@ static inline int pci_vfs_assigned(struct pci_dev *dev)  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))  #define pci_enable_msi_range LINUX_BACKPORT(pci_enable_msi_range)  #ifdef CONFIG_PCI_MSI  int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h index d6d9262b..230d12f8 100644 --- a/backport/backport-include/linux/rcupdate.h +++ b/backport/backport-include/linux/rcupdate.h @@ -41,11 +41,4 @@  #define rcu_dereference_raw(p)	rcu_dereference(p)  #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) -static inline int rcu_read_lock_held(void) -{ -	return 1; -} -#endif -  #endif /* __BACKPORT_LINUX_RCUPDATE_H */ | 
