Repository : ssh://git@diktynna/batman-adv
On branch : master
>---------------------------------------------------------------
commit 1810de05310d5c5e9140f870ac21052f38bc06b8
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Oct 26 22:01:41 2020 +0100
batman-adv: Add new include for min/max helpers
The commit b296a6d53339 ("kernel.h: split out min()/max() et al. helpers")
moved the min/max helper functionality from kernel.h to minmax.h. Adjust
the kernel code accordingly to avoid fragile indirect includes.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
1810de05310d5c5e9140f870ac21052f38bc06b8
compat-include/linux/{build_bug.h => minmax.h} | 12 ++++++------
net/batman-adv/bat_v.c | 1 +
net/batman-adv/bat_v_elp.c | 1 +
net/batman-adv/bat_v_ogm.c | 1 +
net/batman-adv/fragmentation.c | 2 +-
net/batman-adv/hard-interface.c | 1 +
net/batman-adv/icmp_socket.c | 1 +
net/batman-adv/main.c | 1 +
net/batman-adv/netlink.c | 1 +
net/batman-adv/tp_meter.c | 1 +
10 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/compat-include/linux/build_bug.h b/compat-include/linux/minmax.h
similarity index 53%
copy from compat-include/linux/build_bug.h
copy to compat-include/linux/minmax.h
index 5996d9e7..4b19479b 100644
--- a/compat-include/linux/build_bug.h
+++ b/compat-include/linux/minmax.h
@@ -7,14 +7,14 @@
* of the Linux kernel.
*/
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_
+#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_
+#define _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_
#include <linux/version.h>
-#if LINUX_VERSION_IS_GEQ(4, 13, 0)
-#include_next <linux/build_bug.h>
+#if LINUX_VERSION_IS_GEQ(5, 10, 0)
+#include_next <linux/minmax.h>
#else
-#include <linux/bug.h>
+#include <linux/kernel.h>
#endif
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_ */
+#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_ */
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 0ecaf1bb..e91d2c07 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -16,6 +16,7 @@
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/netdevice.h>
#include <linux/netlink.h>
#include <linux/rculist.h>
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 79a7dfc3..0512ea6c 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -18,6 +18,7 @@
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kref.h>
+#include <linux/minmax.h>
#include <linux/netdevice.h>
#include <linux/nl80211.h>
#include <linux/prandom.h>
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index 8c1148fc..798d6598 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -18,6 +18,7 @@
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/lockdep.h>
+#include <linux/minmax.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/prandom.h>
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index 9a47ef8b..97220e19 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -14,8 +14,8 @@
#include <linux/gfp.h>
#include <linux/if_ether.h>
#include <linux/jiffies.h>
-#include <linux/kernel.h>
#include <linux/lockdep.h>
+#include <linux/minmax.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index dad99641..a28fb9ab 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -18,6 +18,7 @@
#include <linux/kref.h>
#include <linux/limits.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/printk.h>
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 8bdabc03..56de4bf2 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -20,6 +20,7 @@
#include <linux/if_ether.h>
#include <linux/kernel.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/pkt_sched.h>
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 70fee9b4..293c62ed 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -23,6 +23,7 @@
#include <linux/kobject.h>
#include <linux/kref.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/printk.h>
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index c7a55647..97bcf149 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -23,6 +23,7 @@
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/netdevice.h>
#include <linux/netlink.h>
#include <linux/printk.h>
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index db7e3774..d4e10005 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -23,6 +23,7 @@
#include <linux/kthread.h>
#include <linux/limits.h>
#include <linux/list.h>
+#include <linux/minmax.h>
#include <linux/netdevice.h>
#include <linux/param.h>
#include <linux/printk.h>