summaryrefslogtreecommitdiff
path: root/backport/compat
diff options
context:
space:
mode:
Diffstat (limited to 'backport/compat')
-rw-r--r--backport/compat/backport-3.13.c8
-rw-r--r--backport/compat/backport-3.18.c26
-rw-r--r--backport/compat/backport-3.19.c2
-rw-r--r--backport/compat/backport-4.1.c4
-rw-r--r--backport/compat/backport-4.3.c8
-rw-r--r--backport/compat/backport-4.4.c2
-rw-r--r--backport/compat/backport-4.5.c6
-rw-r--r--backport/compat/compat-3.3.c6
-rw-r--r--backport/compat/compat-3.4.c8
-rw-r--r--backport/compat/compat-3.5.c4
-rw-r--r--backport/compat/compat-3.7.c4
-rw-r--r--backport/compat/compat-3.8.c4
12 files changed, 41 insertions, 41 deletions
diff --git a/backport/compat/backport-3.13.c b/backport/compat/backport-3.13.c
index 6ce72b2c..496bee60 100644
--- a/backport/compat/backport-3.13.c
+++ b/backport/compat/backport-3.13.c
@@ -17,7 +17,7 @@
#include <linux/device.h>
#include <linux/hwmon.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+#if LINUX_VERSION_IS_GEQ(3,5,0)
#ifdef CONFIG_REGULATOR
#include <linux/module.h>
#include <linux/regulator/driver.h>
@@ -90,7 +90,7 @@ void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev)
}
EXPORT_SYMBOL_GPL(devm_regulator_unregister);
#endif /* CONFIG_REGULATOR */
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) */
+#endif /* LINUX_VERSION_IS_GEQ(3,5,0) */
/************* generic netlink backport *****************/
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
@@ -111,10 +111,10 @@ int __backport_genl_register_family(struct genl_family *family)
__copy(netnsok);
__copy(pre_doit);
__copy(post_doit);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+#if LINUX_VERSION_IS_GEQ(3,10,0)
__copy(parallel_ops);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
+#if LINUX_VERSION_IS_GEQ(3,11,0)
__copy(module);
#endif
#undef __copy
diff --git a/backport/compat/backport-3.18.c b/backport/compat/backport-3.18.c
index 5c3e751e..73db233c 100644
--- a/backport/compat/backport-3.18.c
+++ b/backport/compat/backport-3.18.c
@@ -167,7 +167,7 @@ struct sk_buff *skb_clone_sk(struct sk_buff *skb)
}
EXPORT_SYMBOL_GPL(skb_clone_sk);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+#if LINUX_VERSION_IS_GEQ(3,3,0)
/*
* skb_complete_wifi_ack() needs to get backported, because the version from
* 3.18 added the sock_hold() and sock_put() calles missing in older versions.
@@ -198,7 +198,7 @@ void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
EXPORT_SYMBOL_GPL(skb_complete_wifi_ack);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+#if LINUX_VERSION_IS_GEQ(3,17,0)
int __sched out_of_line_wait_on_bit_timeout(
void *word, int bit, wait_bit_action_f *action,
unsigned mode, unsigned long timeout)
@@ -288,17 +288,17 @@ int of_property_read_u64_array(const struct device_node *np,
EXPORT_SYMBOL_GPL(of_property_read_u64_array);
#endif /* CONFIG_OF */
-#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,3) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,24) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,33) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,60) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,106) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,65) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)))
+#if !(LINUX_VERSION_IS_GEQ(3,17,3) || \
+ (LINUX_VERSION_IS_GEQ(3,14,24) && \
+ LINUX_VERSION_IS_LESS(3,15,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,12,33) && \
+ LINUX_VERSION_IS_LESS(3,13,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,10,60) && \
+ LINUX_VERSION_IS_LESS(3,11,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,4,106) && \
+ LINUX_VERSION_IS_LESS(3,5,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,2,65) && \
+ LINUX_VERSION_IS_LESS(3,3,0)))
/**
* memzero_explicit - Fill a region of memory (e.g. sensitive
* keying data) with 0s.
diff --git a/backport/compat/backport-3.19.c b/backport/compat/backport-3.19.c
index b2db9908..019644df 100644
--- a/backport/compat/backport-3.19.c
+++ b/backport/compat/backport-3.19.c
@@ -16,7 +16,7 @@
#include <linux/skbuff.h>
#include <linux/debugfs.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,12)
+#if LINUX_VERSION_IS_LESS(3,18,12)
static inline bool is_kthread_should_stop(void)
{
return (current->flags & PF_KTHREAD) && kthread_should_stop();
diff --git a/backport/compat/backport-4.1.c b/backport/compat/backport-4.1.c
index f367e3b8..e0a3ec63 100644
--- a/backport/compat/backport-4.1.c
+++ b/backport/compat/backport-4.1.c
@@ -21,7 +21,7 @@ netdev_features_t passthru_features_check(struct sk_buff *skb,
EXPORT_SYMBOL_GPL(passthru_features_check);
#ifdef CONFIG_TTY
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
+#if LINUX_VERSION_IS_GEQ(4,0,0)
static void unset_locked_termios(struct ktermios *termios,
struct ktermios *old,
struct ktermios *locked)
@@ -80,5 +80,5 @@ int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
return 0;
}
EXPORT_SYMBOL_GPL(tty_set_termios);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */
+#endif /* LINUX_VERSION_IS_GEQ(4,0,0) */
#endif /* CONFIG_TTY */
diff --git a/backport/compat/backport-4.3.c b/backport/compat/backport-4.3.c
index 6f4fc3b1..2d8a5e5b 100644
--- a/backport/compat/backport-4.3.c
+++ b/backport/compat/backport-4.3.c
@@ -96,7 +96,7 @@ static int backport_thermal_get_crit_temp(struct thermal_zone_device *dev,
return ret;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#if LINUX_VERSION_IS_GEQ(3, 19, 0)
static int backport_thermal_set_emul_temp(struct thermal_zone_device *dev,
unsigned long temp)
{
@@ -105,7 +105,7 @@ static int backport_thermal_set_emul_temp(struct thermal_zone_device *dev,
return wrapper->driver_ops->set_emul_temp(dev, (int)temp);
}
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+#endif /* LINUX_VERSION_IS_GEQ(3, 19, 0) */
struct thermal_zone_device *backport_thermal_zone_device_register(
const char *type, int trips, int mask, void *devdata,
@@ -146,9 +146,9 @@ struct thermal_zone_device *backport_thermal_zone_device_register(
assign_ops(get_trip_hyst);
assign_ops(set_trip_hyst);
assign_ops(get_crit_temp);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#if LINUX_VERSION_IS_GEQ(3, 19, 0)
assign_ops(set_emul_temp);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+#endif /* LINUX_VERSION_IS_GEQ(3, 19, 0) */
#undef assign_ops
ret = old_thermal_zone_device_register(type, trips, mask, devdata,
diff --git a/backport/compat/backport-4.4.c b/backport/compat/backport-4.4.c
index 88543859..1c11a206 100644
--- a/backport/compat/backport-4.4.c
+++ b/backport/compat/backport-4.4.c
@@ -20,7 +20,7 @@
#include <asm/unaligned.h>
#ifdef CONFIG_DEBUG_FS
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
+#if LINUX_VERSION_IS_LESS(4,3,0)
static ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
diff --git a/backport/compat/backport-4.5.c b/backport/compat/backport-4.5.c
index bbf4f3bb..69751d51 100644
--- a/backport/compat/backport-4.5.c
+++ b/backport/compat/backport-4.5.c
@@ -20,7 +20,7 @@
#include <linux/string.h>
#include <asm/uaccess.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
+#if LINUX_VERSION_IS_GEQ(3,19,0)
int led_set_brightness_sync(struct led_classdev *led_cdev,
enum led_brightness value)
{
@@ -40,7 +40,7 @@ int led_set_brightness_sync(struct led_classdev *led_cdev,
EXPORT_SYMBOL_GPL(led_set_brightness_sync);
#endif /* >= 3.19 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+#if LINUX_VERSION_IS_GEQ(3,2,0)
/**
* no_seek_end_llseek - llseek implementation for fixed-sized devices
* @file: file structure to seek on
@@ -52,7 +52,7 @@ loff_t no_seek_end_llseek(struct file *file, loff_t offset, int whence)
{
switch (whence) {
case SEEK_SET: case SEEK_CUR:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+#if LINUX_VERSION_IS_GEQ(3,6,0)
return generic_file_llseek_size(file, offset, whence,
~0ULL, 0);
#else
diff --git a/backport/compat/compat-3.3.c b/backport/compat/compat-3.3.c
index 490c29bd..c064f09d 100644
--- a/backport/compat/compat-3.3.c
+++ b/backport/compat/compat-3.3.c
@@ -25,10 +25,10 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
new->mac_header = old->mac_header;
skb_dst_copy(new, old);
new->rxhash = old->rxhash;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#if LINUX_VERSION_IS_GEQ(3,1,0)
new->ooo_okay = old->ooo_okay;
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if LINUX_VERSION_IS_GEQ(3,2,0)
new->l4_rxhash = old->l4_rxhash;
#endif
#ifdef CONFIG_XFRM
@@ -145,7 +145,7 @@ struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask)
#endif
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i];
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if LINUX_VERSION_IS_GEQ(3,2,0)
skb_frag_ref(skb, i);
#else
get_page(skb_shinfo(skb)->frags[i].page);
diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c
index bc090b78..52753725 100644
--- a/backport/compat/compat-3.4.c
+++ b/backport/compat/compat-3.4.c
@@ -14,13 +14,13 @@
#include <linux/compat.h>
#include <asm/uaccess.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if LINUX_VERSION_IS_GEQ(3,2,0)
#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+#endif /* LINUX_VERSION_IS_GEQ(3,2,0) */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if LINUX_VERSION_IS_GEQ(3,2,0)
#if defined(CONFIG_REGMAP)
static void devm_regmap_release(struct device *dev, void *res)
@@ -172,7 +172,7 @@ EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
#endif /* defined(CONFIG_REGMAP_I2C) */
#endif /* defined(CONFIG_REGMAP) */
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+#endif /* LINUX_VERSION_IS_GEQ(3,2,0) */
int simple_open(struct inode *inode, struct file *file)
{
diff --git a/backport/compat/compat-3.5.c b/backport/compat/compat-3.5.c
index 1b8f7874..de312283 100644
--- a/backport/compat/compat-3.5.c
+++ b/backport/compat/compat-3.5.c
@@ -15,7 +15,7 @@
#include <linux/gpio.h>
#include <linux/ptp_clock_kernel.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if LINUX_VERSION_IS_GEQ(3,2,0)
#include <linux/device.h>
/**
@@ -47,7 +47,7 @@ int devres_release(struct device *dev, dr_release_t release,
return 0;
}
EXPORT_SYMBOL_GPL(devres_release);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+#endif /* LINUX_VERSION_IS_GEQ(3,2,0) */
/*
* Commit 7a4e7408c5cadb240e068a662251754a562355e3
diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c
index e3721676..a70709c9 100644
--- a/backport/compat/compat-3.7.c
+++ b/backport/compat/compat-3.7.c
@@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(pcie_capability_clear_and_set_dword);
#endif
#ifdef CONFIG_OF
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+#if LINUX_VERSION_IS_LESS(3,7,0)
/**
* of_get_child_by_name - Find the child node by name for a given parent
* @node: parent node
@@ -277,7 +277,7 @@ struct device_node *of_get_child_by_name(const struct device_node *node,
return child;
}
EXPORT_SYMBOL_GPL(of_get_child_by_name);
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */
+#endif /* LINUX_VERSION_IS_LESS(3,7,0) */
#endif /* CONFIG_OF */
int sg_nents(struct scatterlist *sg)
diff --git a/backport/compat/compat-3.8.c b/backport/compat/compat-3.8.c
index 7e1b9797..ff9cd493 100644
--- a/backport/compat/compat-3.8.c
+++ b/backport/compat/compat-3.8.c
@@ -22,7 +22,7 @@
#include <linux/pci.h>
#include <linux/pci_regs.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,8))
+#if LINUX_VERSION_IS_LESS(3,7,8)
void netdev_set_default_ethtool_ops(struct net_device *dev,
const struct ethtool_ops *ops)
{
@@ -275,7 +275,7 @@ static bool hid_match_one_id(struct hid_device *hdev,
const struct hid_device_id *id)
{
return (id->bus == HID_BUS_ANY || id->bus == hdev->bus) &&
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+#if LINUX_VERSION_IS_GEQ(3,8,0)
(id->group == HID_GROUP_ANY || id->group == hdev->group) &&
#endif
(id->vendor == HID_ANY_ID || id->vendor == hdev->vendor) &&