@@ -55,7 +55,6 @@ jobs:
strategy:
matrix:
kernel: [
- "4.4",
"4.5",
"4.6",
"4.7",
@@ -8,7 +8,7 @@ down to older kernels. It currently backports the following subsystems:
* WWAN
This package provides the latest Linux kernel subsystem enhancements
-for kernels 4.4 and above.
+for kernels 4.5 and above.
# Documentation
@@ -4,8 +4,7 @@
#if LINUX_VERSION_IS_GEQ(4,19,0) || \
LINUX_VERSION_IN_RANGE(4,14,119, 4,15,0) || \
- LINUX_VERSION_IN_RANGE(4,9,176, 4,10,0) || \
- LINUX_VERSION_IN_RANGE(4,4,180, 4,5,0)
+ LINUX_VERSION_IN_RANGE(4,9,176, 4,10,0)
#include_next <linux/bits.h>
#else
#include <linux/bitops.h>
@@ -4,11 +4,6 @@
#include <linux/version.h>
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define no_seek_end_llseek LINUX_BACKPORT(no_seek_end_llseek)
-extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
-#endif /* < 4.5 */
-
#if LINUX_VERSION_IS_LESS(5,5,0)
#ifdef CONFIG_COMPAT
#define compat_ptr_ioctl LINUX_BACKPORT(compat_ptr_ioctl)
@@ -6,11 +6,6 @@
#define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err)
#endif
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define __ioread32_copy LINUX_BACKPORT(__ioread32_copy)
-void __ioread32_copy(void *to, const void __iomem *from, size_t count);
-#endif
-
#ifndef writel_relaxed
#define writel_relaxed writel_relaxed
static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
@@ -13,32 +13,4 @@ int __must_check kstrtobool(const char *s, bool *res);
int __must_check kstrtobool_from_user(const char __user *s, size_t count, bool *res);
#endif
-#if LINUX_VERSION_IS_LESS(4,5,0)
-
-#undef abs
-/**
- * abs - return absolute value of an argument
- * @x: the value. If it is unsigned type, it is converted to signed type first.
- * char is treated as if it was signed (regardless of whether it really is)
- * but the macro's return type is preserved as char.
- *
- * Return: an absolute value of x.
- */
-#define abs(x) __abs_choose_expr(x, long long, \
- __abs_choose_expr(x, long, \
- __abs_choose_expr(x, int, \
- __abs_choose_expr(x, short, \
- __abs_choose_expr(x, char, \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(x), char), \
- (char)({ signed char __x = (x); __x<0?-__x:__x; }), \
- ((void)0)))))))
-
-#define __abs_choose_expr(x, type, other) __builtin_choose_expr( \
- __builtin_types_compatible_p(typeof(x), signed type) || \
- __builtin_types_compatible_p(typeof(x), unsigned type), \
- ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
-
-#endif
-
#endif /* __BACKPORT_KERNEL_H */
deleted file mode 100644
@@ -1,29 +0,0 @@
-#ifndef __BACKPORT_LINUX_LEDS_H
-#define __BACKPORT_LINUX_LEDS_H
-#include_next <linux/leds.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define led_set_brightness_sync LINUX_BACKPORT(led_set_brightness_sync)
-/**
- * led_set_brightness_sync - set LED brightness synchronously
- * @led_cdev: the LED to set
- * @brightness: the brightness to set it to
- *
- * Set an LED's brightness immediately. This function will block
- * the caller for the time required for accessing device registers,
- * and it can sleep.
- *
- * Returns: 0 on success or negative error value on failure
- */
-extern int led_set_brightness_sync(struct led_classdev *led_cdev,
- enum led_brightness value);
-#endif /* < 4.5 */
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define devm_led_trigger_register LINUX_BACKPORT(devm_led_trigger_register)
-extern int devm_led_trigger_register(struct device *dev,
- struct led_trigger *trigger);
-#endif /* < 4.5 */
-
-#endif /* __BACKPORT_LINUX_LEDS_H */
@@ -23,28 +23,6 @@ static inline bool backport_napi_complete(struct napi_struct *n)
#define napi_complete LINUX_BACKPORT(napi_complete)
#endif /* < 4.10 */
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define netif_tx_napi_add LINUX_BACKPORT(netif_tx_napi_add)
-/**
- * netif_tx_napi_add - initialize a napi context
- * @dev: network device
- * @napi: napi context
- * @poll: polling function
- * @weight: default weight
- *
- * This variant of netif_napi_add() should be used from drivers using NAPI
- * to exclusively poll a TX queue.
- * This will avoid we add it into napi_hash[], thus polluting this hash table.
- */
-static inline void netif_tx_napi_add(struct net_device *dev,
- struct napi_struct *napi,
- int (*poll)(struct napi_struct *, int),
- int weight)
-{
- netif_napi_add(dev, napi, poll, weight);
-}
-#endif /* < 4.5 */
-
#ifndef NETIF_F_CSUM_MASK
#define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
#endif
@@ -3,8 +3,7 @@
#if LINUX_VERSION_IS_GEQ(4,15,2) || \
LINUX_VERSION_IN_RANGE(4,14,18, 4,15,0) || \
- LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0) || \
- LINUX_VERSION_IN_RANGE(4,4,118, 4,5,0)
+ LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0)
#include_next <linux/nospec.h>
#else
#define array_index_nospec(index, size) (index)
@@ -9,12 +9,10 @@ static inline void page_ref_inc(struct page *page)
atomic_inc(&page->_count);
}
-#if !LINUX_VERSION_IN_RANGE(4,4,216, 4,5,0)
static inline int page_ref_count(struct page *page)
{
return atomic_read(&page->_count);
}
-#endif /* 4.4.216 <= x < 4.5 */
static inline int page_ref_sub_and_test(struct page *page, int nr)
{
@@ -30,7 +30,6 @@ static inline void pci_free_irq_vectors(struct pci_dev *dev)
#if LINUX_VERSION_IS_LESS(4,9,0) && \
- !LINUX_VERSION_IN_RANGE(4,4,37, 4,5,0) && \
!LINUX_VERSION_IN_RANGE(4,8,13, 4,9,0)
static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
@@ -47,7 +46,7 @@ static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
return NULL;
}
-#endif/* <4.9.0 but not >= 4.4.37, 4.8.13 */
+#endif/* <4.9.0 but not >= 4.8.13 */
#ifndef PCI_IRQ_LEGACY
#define PCI_IRQ_LEGACY (1 << 0) /* Allow legacy interrupts */
deleted file mode 100644
@@ -1,65 +0,0 @@
-#ifndef __BACKPORT_LINUX_PHY_H
-#define __BACKPORT_LINUX_PHY_H
-#include_next <linux/phy.h>
-#include <linux/compiler.h>
-#include <linux/version.h>
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define phydev_name LINUX_BACKPORT(phydev_name)
-static inline const char *phydev_name(const struct phy_device *phydev)
-{
- return dev_name(&phydev->dev);
-}
-
-#define mdiobus_is_registered_device LINUX_BACKPORT(mdiobus_is_registered_device)
-static inline bool mdiobus_is_registered_device(struct mii_bus *bus, int addr)
-{
- return bus->phy_map[addr];
-}
-
-#define phy_attached_print LINUX_BACKPORT(phy_attached_print)
-void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
- __printf(2, 3);
-#define phy_attached_info LINUX_BACKPORT(phy_attached_info)
-void phy_attached_info(struct phy_device *phydev);
-
-static inline int backport_mdiobus_register(struct mii_bus *bus)
-{
- bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
- if (!bus->irq) {
- pr_err("mii_bus irq allocation failed\n");
- return -ENOMEM;
- }
-
- memset(bus->irq, PHY_POLL, sizeof(int) * PHY_MAX_ADDR);
-
- return __mdiobus_register(bus, THIS_MODULE);
-}
-#ifdef mdiobus_register
-#undef mdiobus_register
-#endif
-#define mdiobus_register LINUX_BACKPORT(mdiobus_register)
-
-static inline void backport_mdiobus_unregister(struct mii_bus *bus)
-{
- kfree(bus->irq);
- mdiobus_unregister(bus);
-}
-#define mdiobus_unregister LINUX_BACKPORT(mdiobus_unregister)
-#endif /* < 4.5 */
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define phydev_get_addr LINUX_BACKPORT(phydev_get_addr)
-static inline int phydev_get_addr(struct phy_device *phydev)
-{
- return phydev->addr;
-}
-#else
-#define phydev_get_addr LINUX_BACKPORT(phydev_get_addr)
-static inline int phydev_get_addr(struct phy_device *phydev)
-{
- return phydev->mdio.addr;
-}
-#endif
-
-#endif /* __BACKPORT_LINUX_PHY_H */
@@ -108,8 +108,7 @@ static inline void nf_reset_ct(struct sk_buff *skb)
!LINUX_VERSION_IN_RANGE(5,4,69, 5,5,0) && \
!LINUX_VERSION_IN_RANGE(4,19,149, 4,20,0) && \
!LINUX_VERSION_IN_RANGE(4,14,200, 4,15,0) && \
- !LINUX_VERSION_IN_RANGE(4,9,238, 4,10,0) && \
- !LINUX_VERSION_IN_RANGE(4,4,238, 4,5,0)
+ !LINUX_VERSION_IN_RANGE(4,9,238, 4,10,0)
/**
* skb_queue_len_lockless - get queue length
* @list_: list to measure
@@ -3,11 +3,6 @@
#include_next <linux/string.h>
#include <linux/version.h>
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define memdup_user_nul LINUX_BACKPORT(memdup_user_nul)
-extern void *memdup_user_nul(const void __user *, size_t);
-#endif
-
#if LINUX_VERSION_IS_LESS(4,6,0)
int match_string(const char * const *array, size_t n, const char *string);
#endif /* LINUX_VERSION_IS_LESS(4,5,0) */
@@ -91,10 +91,7 @@ struct backport_genl_ops {
void *__dummy_was_policy_must_be_null;
int (*doit)(struct sk_buff *skb,
struct genl_info *info);
-#if LINUX_VERSION_IS_GEQ(4,5,0) || \
- LINUX_VERSION_IN_RANGE(4,4,104, 4,5,0)
int (*start)(struct netlink_callback *cb);
-#endif
int (*dumpit)(struct sk_buff *skb,
struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
@@ -111,10 +108,7 @@ __real_backport_genl_register_family(struct genl_family *family)
BUILD_BUG_ON(offsetof(struct genl_ops, f) != \
offsetof(struct backport_genl_ops, f))
OPS_VALIDATE(doit);
-#if LINUX_VERSION_IS_GEQ(4,5,0) || \
- LINUX_VERSION_IN_RANGE(4,4,104, 4,5,0)
OPS_VALIDATE(start);
-#endif
OPS_VALIDATE(dumpit);
OPS_VALIDATE(done);
OPS_VALIDATE(cmd);
deleted file mode 100644
@@ -1,25 +0,0 @@
-#ifndef __BACKPORT_NET_IPV6_H
-#define __BACKPORT_NET_IPV6_H
-#include_next <net/ipv6.h>
-#include <linux/version.h>
-
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define ipv6_addr_prefix_copy LINUX_BACKPORT(ipv6_addr_prefix_copy)
-static inline void ipv6_addr_prefix_copy(struct in6_addr *addr,
- const struct in6_addr *pfx,
- int plen)
-{
- /* caller must guarantee 0 <= plen <= 128 */
- int o = plen >> 3,
- b = plen & 0x7;
-
- memcpy(addr->s6_addr, pfx, o);
- if (b != 0) {
- addr->s6_addr[o] &= ~(0xff00 >> b);
- addr->s6_addr[o] |= (pfx->s6_addr[o] & (0xff00 >> b));
- }
-}
-#endif
-
-#endif /* __BACKPORT_NET_IPV6_H */
deleted file mode 100644
@@ -1,11 +0,0 @@
-#ifndef __BACKPORT_IW_HANDLER_H
-#define __BACKPORT_IW_HANDLER_H
-#include_next <net/iw_handler.h>
-
-
-/* this was added in v3.2.79, v3.18.30, v4.1.21, v4.4.6 and 4.5 */
-#if !LINUX_VERSION_IS_GEQ(4,4,6)
-#define wireless_nlevent_flush LINUX_BACKPORT(wireless_nlevent_flush)
-static inline void wireless_nlevent_flush(void) {}
-#endif
-#endif /* __BACKPORT_IW_HANDLER_H */
@@ -3,23 +3,6 @@
#include_next <net/sock.h>
#include <linux/version.h>
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define sk_set_bit LINUX_BACKPORT(sk_set_bit)
-static inline void sk_set_bit(int nr, struct sock *sk)
-{
- set_bit(nr, &sk->sk_socket->flags);
-}
-#endif /* < 4.5 */
-
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define sk_clear_bit LINUX_BACKPORT(sk_clear_bit)
-static inline void sk_clear_bit(int nr, struct sock *sk)
-{
- clear_bit(nr, &sk->sk_socket->flags);
-}
-#endif /* < 4.5 */
-
#if LINUX_VERSION_IS_LESS(4,16,0)
#define sk_pacing_shift_update LINUX_BACKPORT(sk_pacing_shift_update)
static inline void sk_pacing_shift_update(struct sock *sk, int val)
@@ -7,7 +7,6 @@ endif
compat-y += main.o
# Kernel backport compatibility code
-compat-$(CPTCFG_KERNEL_4_5) += backport-4.5.o
compat-$(CPTCFG_KERNEL_4_6) += backport-4.6.o
compat-$(CPTCFG_KERNEL_4_7) += backport-4.7.o
compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
deleted file mode 100644
@@ -1,165 +0,0 @@
-/*
- * Copyright(c) 2015 Hauke Mehrtens <hauke@hauke-m.de>
- *
- * Backport functionality introduced in Linux 4.5.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/device.h>
-#include <linux/export.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/leds.h>
-#include <linux/phy.h>
-#include <linux/printk.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <asm/uaccess.h>
-#include <linux/io.h>
-
-int led_set_brightness_sync(struct led_classdev *led_cdev,
- enum led_brightness value)
-{
- if (led_cdev->blink_delay_on || led_cdev->blink_delay_off)
- return -EBUSY;
-
- led_cdev->brightness = min(value, led_cdev->max_brightness);
-
- if (led_cdev->flags & LED_SUSPENDED)
- return 0;
-
- if (led_cdev->brightness_set_sync)
- return led_cdev->brightness_set_sync(led_cdev,
- led_cdev->brightness);
- return -ENOTSUPP;
-}
-EXPORT_SYMBOL_GPL(led_set_brightness_sync);
-
-/**
- * no_seek_end_llseek - llseek implementation for fixed-sized devices
- * @file: file structure to seek on
- * @offset: file offset to seek to
- * @whence: type of seek
- *
- */
-loff_t no_seek_end_llseek(struct file *file, loff_t offset, int whence)
-{
- switch (whence) {
- case SEEK_SET: case SEEK_CUR:
- return generic_file_llseek_size(file, offset, whence,
- ~0ULL, 0);
- default:
- return -EINVAL;
- }
-}
-EXPORT_SYMBOL_GPL(no_seek_end_llseek);
-
-/**
- * memdup_user_nul - duplicate memory region from user space and NUL-terminate
- *
- * @src: source address in user space
- * @len: number of bytes to copy
- *
- * Returns an ERR_PTR() on failure.
- */
-void *memdup_user_nul(const void __user *src, size_t len)
-{
- char *p;
-
- /*
- * Always use GFP_KERNEL, since copy_from_user() can sleep and
- * cause pagefault, which makes it pointless to use GFP_NOFS
- * or GFP_ATOMIC.
- */
- p = kmalloc(len + 1, GFP_KERNEL);
- if (!p)
- return ERR_PTR(-ENOMEM);
-
- if (copy_from_user(p, src, len)) {
- kfree(p);
- return ERR_PTR(-EFAULT);
- }
- p[len] = '\0';
-
- return p;
-}
-EXPORT_SYMBOL_GPL(memdup_user_nul);
-
-void phy_attached_info(struct phy_device *phydev)
-{
- phy_attached_print(phydev, NULL);
-}
-EXPORT_SYMBOL_GPL(phy_attached_info);
-
-#define ATTACHED_FMT "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)"
-void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
-{
- if (!fmt) {
- dev_info(&phydev->dev, ATTACHED_FMT "\n",
- phydev->drv->name, phydev_name(phydev),
- phydev->irq);
- } else {
- va_list ap;
-
- dev_info(&phydev->dev, ATTACHED_FMT,
- phydev->drv->name, phydev_name(phydev),
- phydev->irq);
-
- va_start(ap, fmt);
- vprintk(fmt, ap);
- va_end(ap);
- }
-}
-EXPORT_SYMBOL_GPL(phy_attached_print);
-
-static void devm_led_trigger_release(struct device *dev, void *res)
-{
- led_trigger_unregister(*(struct led_trigger **)res);
-}
-
-int devm_led_trigger_register(struct device *dev,
- struct led_trigger *trig)
-{
- struct led_trigger **dr;
- int rc;
-
- dr = devres_alloc(devm_led_trigger_release, sizeof(*dr),
- GFP_KERNEL);
- if (!dr)
- return -ENOMEM;
-
- *dr = trig;
-
- rc = led_trigger_register(trig);
- if (rc)
- devres_free(dr);
- else
- devres_add(dev, dr);
-
- return rc;
-}
-EXPORT_SYMBOL_GPL(devm_led_trigger_register);
-
-/**
- * __ioread32_copy - copy data from MMIO space, in 32-bit units
- * @to: destination (must be 32-bit aligned)
- * @from: source, in MMIO space (must be 32-bit aligned)
- * @count: number of 32-bit quantities to copy
- *
- * Copy data from MMIO space to kernel space, in units of 32 bits at a
- * time. Order of access is not guaranteed, nor is a memory barrier
- * performed afterwards.
- */
-void __ioread32_copy(void *to, const void __iomem *from, size_t count)
-{
- u32 *dst = to;
- const u32 __iomem *src = from;
- const u32 __iomem *end = src + count;
-
- while (src < end)
- *dst++ = __raw_readl(src++);
-}
-EXPORT_SYMBOL_GPL(__ioread32_copy);
deleted file mode 100644
@@ -1,25 +0,0 @@
-/* convert gpio: change member .dev to .parent
- *
- * add semantic patch which uses the dev member of struct gpio_chip on
- * kenrel version < 4.5 This change was done in upstream kernel commit
- * 58383c78 "gpio: change member .dev to .parent".
- */
-
-@r1@
-struct gpio_chip *chip;
-expression E1;
-@@
-+#if LINUX_VERSION_IS_GEQ(4,5,0)
- chip->parent = E1;
-+#else
-+chip->dev = E1;
-+#endif /* LINUX_VERSION_IS_GEQ(4,5,0) */
-@r2@
-struct gpio_chip chip;
-expression E2;
-@@
-+#if LINUX_VERSION_IS_GEQ(4,5,0)
- chip.parent = E2;
-+#else
-+chip.dev = E2;
-+#endif /* LINUX_VERSION_IS_GEQ(4,5,0) */
deleted file mode 100644
@@ -1,5 +0,0 @@
-@ r1 @
-struct phy_device *phydev;
-@@
--phydev->mdio.addr
-+phydev_get_addr(phydev)