@@ -32,7 +32,6 @@
#include "soft-interface.h"
#include "vis.h"
#include "icmp_socket.h"
-#include "compat.h"
static struct dentry *bat_debugfs;
@@ -30,7 +30,8 @@
#include <asm/page.h> /* for PAGE_SIZE */
#include <asm/div64.h>
#include <asm/sections.h> /* for dereference_function_descriptor() */
-#include "compat.h"
+
+#include "main.h"
/* Works only for digits and letters, but small and fast */
#define TOLOWER(x) ((x) | 0x20)
@@ -27,7 +27,6 @@
#include "gateway_common.h"
#include "gateway_client.h"
#include "vis.h"
-#include "compat.h"
#define to_dev(obj) container_of(obj, struct device, kobj)
#define kobj_to_netdev(obj) to_net_dev(to_dev(obj->parent))
@@ -23,7 +23,6 @@
#include "gateway_client.h"
#include "gateway_common.h"
#include "hard-interface.h"
-#include "compat.h"
#include <linux/ip.h>
#include <linux/udp.h>
#include <linux/if_vlan.h>
@@ -22,7 +22,6 @@
#include "main.h"
#include "gateway_common.h"
#include "gateway_client.h"
-#include "compat.h"
/* calculates the gateway class from kbit */
static void kbit_to_gw_srv_class(int down, int up, long *gw_srv_class)
@@ -31,8 +31,6 @@
#include <linux/if_arp.h>
-#include "compat.h"
-
#define MIN(x, y) ((x) < (y) ? (x) : (y))
/* protect update critical side of if_list - but not the content */
@@ -28,9 +28,6 @@
#include "hash.h"
#include "hard-interface.h"
-#include "compat.h"
-
-
static struct socket_client *socket_client_hash[256];
static void bat_socket_add_packet(struct socket_client *socket_client,
@@ -33,7 +33,6 @@
#include "types.h"
#include "vis.h"
#include "hash.h"
-#include "compat.h"
struct list_head if_list;
@@ -88,6 +88,9 @@
/*
* Debug Messages
*/
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* Append 'batman-adv: ' before
* kernel messages */
@@ -123,6 +126,8 @@
#include <linux/seq_file.h>
#include "types.h"
+#include "compat.h"
+
#ifndef REVISION_VERSION
#define REVISION_VERSION_STR ""
#else
@@ -26,7 +26,6 @@
#include "hash.h"
#include "translation-table.h"
#include "routing.h"
-#include "compat.h"
#include "gateway_client.h"
#include "hard-interface.h"
#include "unicast.h"
@@ -32,7 +32,6 @@
#include "ring_buffer.h"
#include "vis.h"
#include "aggregation.h"
-#include "compat.h"
#include "gateway_client.h"
#include "unicast.h"
@@ -30,8 +30,6 @@
#include "aggregation.h"
#include "gateway_common.h"
-#include "compat.h"
-
static void send_outstanding_bcast_packet(struct work_struct *work);
/* apply hop penalty for a normal link */
@@ -36,7 +36,6 @@
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
-#include "compat.h"
#include "unicast.h"
#include "routing.h"
@@ -24,7 +24,6 @@
#include "soft-interface.h"
#include "types.h"
#include "hash.h"
-#include "compat.h"
static void hna_local_purge(struct work_struct *work);
static void _hna_global_del_orig(struct bat_priv *bat_priv,
@@ -26,7 +26,6 @@
#include "soft-interface.h"
#include "hard-interface.h"
#include "hash.h"
-#include "compat.h"
#define MAX_VIS_PACKET_SIZE 1000
compat.h is included in all files which may need newer functionality than the target kernel has. This include is may forgotton when new changes are made to the sources. The compat.h can also be included in main.h which is included by all source files. In theory also all header files must include main.h. This is currently not and hopefully will never be necessary. It is also important that all header files which declare functions which are redefined in compat.h to be included before compat.h is included. Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> --- batman-adv/bat_debugfs.c | 1 - batman-adv/bat_printk.c | 3 ++- batman-adv/bat_sysfs.c | 1 - batman-adv/gateway_client.c | 1 - batman-adv/gateway_common.c | 1 - batman-adv/hard-interface.c | 2 -- batman-adv/icmp_socket.c | 3 --- batman-adv/main.c | 1 - batman-adv/main.h | 5 +++++ batman-adv/originator.c | 1 - batman-adv/routing.c | 1 - batman-adv/send.c | 2 -- batman-adv/soft-interface.c | 1 - batman-adv/translation-table.c | 1 - batman-adv/vis.c | 1 - 15 files changed, 7 insertions(+), 18 deletions(-)