Skip to content

Commit

Permalink
backports: Remove support for kernel smaller than 4.8
Browse files Browse the repository at this point in the history
This removes all the code which is needed to support kernel 4.7.

Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke committed Feb 5, 2024
1 parent 1178f46 commit d16bd42
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 341 deletions.
1 change: 0 additions & 1 deletion .github/workflows/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
strategy:
matrix:
kernel: [
"4.7",
"4.8",
"4.9",
"4.10",
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -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.7 and above.
for kernels 4.8 and above.

# Documentation

Expand Down
48 changes: 0 additions & 48 deletions backport/backport-include/linux/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@
#define __BP_ATOMIC_H
#include_next <linux/atomic.h>

/* atomic_cmpxchg_relaxed */
#ifndef atomic_cmpxchg_relaxed
#define atomic_cmpxchg_relaxed atomic_cmpxchg
#define atomic_cmpxchg_acquire atomic_cmpxchg
#define atomic_cmpxchg_release atomic_cmpxchg

#else /* atomic_cmpxchg_relaxed */

#ifndef atomic_cmpxchg_acquire
#define atomic_cmpxchg_acquire(...) \
__atomic_op_acquire(atomic_cmpxchg, __VA_ARGS__)
#endif

#ifndef atomic_cmpxchg_release
#define atomic_cmpxchg_release(...) \
__atomic_op_release(atomic_cmpxchg, __VA_ARGS__)
#endif

#ifndef atomic_cmpxchg
#define atomic_cmpxchg(...) \
__atomic_op_fence(atomic_cmpxchg, __VA_ARGS__)
#endif
#endif /* atomic_cmpxchg_relaxed */

/* these were introduced together, so just a single check is enough */
#ifndef atomic_try_cmpxchg_acquire
#ifndef atomic_try_cmpxchg
Expand Down Expand Up @@ -68,28 +44,4 @@ static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
#define __atomic_post_full_fence smp_mb__after_atomic
#endif

#if LINUX_VERSION_IS_LESS(4,8,0)
static inline int
atomic_fetch_add(int i, atomic_t *v)
{
return atomic_add_return(i, v) - i;
}

static inline int
atomic_fetch_sub(int i, atomic_t *v)
{
return atomic_sub_return(i, v) + i;
}
#endif

#ifndef atomic_fetch_add_relaxed
#define atomic_fetch_add_relaxed atomic_fetch_add
#endif

#ifndef atomic_fetch_sub_relaxed
#define atomic_fetch_sub_acquire atomic_fetch_sub
#define atomic_fetch_sub_release atomic_fetch_sub
#define atomic_fetch_sub_relaxed atomic_fetch_sub
#endif

#endif /* __BP_ATOMIC_H */
5 changes: 2 additions & 3 deletions backport/backport-include/linux/debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include <linux/device.h>

#if LINUX_VERSION_IS_LESS(4,9,0) && \
!LINUX_VERSION_IN_RANGE(4,8,4, 4,9,0) && \
!LINUX_VERSION_IN_RANGE(4,7,10, 4,8,0)
!LINUX_VERSION_IN_RANGE(4,8,4, 4,9,0)
static inline const struct file_operations *
debugfs_real_fops(const struct file *filp)
{
Expand All @@ -16,7 +15,7 @@ debugfs_real_fops(const struct file *filp)
*/
return filp->f_path.dentry->d_fsdata;
}
#endif /* <4.9.0 but not >= 4.8.4, 4.7.10 */
#endif /* <4.9.0 but not >= 4.8.4 */

#ifndef DEFINE_DEBUGFS_ATTRIBUTE
#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \
Expand Down
22 changes: 0 additions & 22 deletions backport/backport-include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,6 @@
#include <linux/pci-aspm.h>
#endif



#if LINUX_VERSION_IS_LESS(4,8,0)
#define pci_alloc_irq_vectors LINUX_BACKPORT(pci_alloc_irq_vectors)
#ifdef CONFIG_PCI_MSI
int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
unsigned int max_vecs, unsigned int flags);
#else
static inline int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
unsigned int max_vecs, unsigned int flags)
{ return -ENOSYS; }
#endif
#endif

#if LINUX_VERSION_IS_LESS(4,8,0)
#define pci_free_irq_vectors LINUX_BACKPORT(pci_free_irq_vectors)
static inline void pci_free_irq_vectors(struct pci_dev *dev)
{
}
#endif


#if LINUX_VERSION_IS_LESS(4,9,0) && \
!LINUX_VERSION_IN_RANGE(4,8,13, 4,9,0)

Expand Down
8 changes: 0 additions & 8 deletions backport/backport-include/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@

#include <linux/time64.h>

#if LINUX_VERSION_IS_LESS(4,8,0)
static inline void time64_to_tm(time64_t totalsecs, int offset,
struct tm *result)
{
time_to_tm((time_t)totalsecs, 0, result);
}
#endif

#ifndef time_after32
/**
* time_after32 - compare two 32-bit relative times
Expand Down
61 changes: 0 additions & 61 deletions backport/backport-include/linux/usb/cdc.h

This file was deleted.

1 change: 0 additions & 1 deletion backport/compat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ endif
compat-y += main.o

# Kernel backport compatibility code
compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
compat-$(CPTCFG_KERNEL_4_11) += backport-4.11.o
compat-$(CPTCFG_KERNEL_4_12) += backport-4.12.o
Expand Down
Loading

0 comments on commit d16bd42

Please sign in to comment.