The following commit has been merged in the next branch: commit d8f0323b7459ec8b075079d0d4b7cb87a9268644 Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Mon Oct 25 21:49:17 2010 +0000
batman-adv: Include compat.h only once
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
diff --git a/bat_debugfs.c b/bat_debugfs.c index 2ea81b9..cbac1a5 100644 --- a/bat_debugfs.c +++ b/bat_debugfs.c @@ -30,7 +30,6 @@ #include "soft-interface.h" #include "vis.h" #include "icmp_socket.h" -#include "compat.h"
static struct dentry *bat_debugfs;
diff --git a/bat_printk.c b/bat_printk.c index b0e732b..f4561c3 100644 --- a/bat_printk.c +++ b/bat_printk.c @@ -34,7 +34,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) diff --git a/bat_sysfs.c b/bat_sysfs.c index cc4aeba..5ff6e5e 100644 --- a/bat_sysfs.c +++ b/bat_sysfs.c @@ -25,7 +25,6 @@ #include "originator.h" #include "hard-interface.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)) diff --git a/hard-interface.c b/hard-interface.c index 59299fa..327d487 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -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 */ diff --git a/icmp_socket.c b/icmp_socket.c index 8a6f76c..ecf6d7f 100644 --- a/icmp_socket.c +++ b/icmp_socket.c @@ -29,9 +29,6 @@ #include "originator.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, diff --git a/main.c b/main.c index 50ad9c8..61d1aa6 100644 --- a/main.c +++ b/main.c @@ -32,7 +32,6 @@ #include "types.h" #include "vis.h" #include "hash.h" -#include "compat.h"
struct list_head if_list;
diff --git a/main.h b/main.h index 3ee1eb0..8700508 100644 --- a/main.h +++ b/main.h @@ -85,6 +85,9 @@ /* * Debug Messages */ +#ifdef pr_fmt +#undef pr_fmt +#endif #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* Append 'batman-adv: ' before * kernel messages */
@@ -120,6 +123,8 @@ #include <linux/seq_file.h> #include "types.h"
+#include "compat.h" + #ifndef REVISION_VERSION #define REVISION_VERSION_STR "" #else diff --git a/originator.c b/originator.c index ba6d138..8bef468 100644 --- a/originator.c +++ b/originator.c @@ -26,7 +26,6 @@ #include "hash.h" #include "translation-table.h" #include "routing.h" -#include "compat.h" #include "hard-interface.h" #include "unicast.h" #include "soft-interface.h" diff --git a/routing.c b/routing.c index 7741d05..1536963 100644 --- a/routing.c +++ b/routing.c @@ -32,7 +32,6 @@ #include "ring_buffer.h" #include "vis.h" #include "aggregation.h" -#include "compat.h" #include "unicast.h"
void slide_own_bcast_window(struct batman_if *batman_if) diff --git a/send.c b/send.c index 0ad0aad..4d7d6a5 100644 --- a/send.c +++ b/send.c @@ -30,8 +30,6 @@ #include "aggregation.h" #include "originator.h"
-#include "compat.h" - static void send_outstanding_bcast_packet(struct work_struct *work);
/* apply hop penalty for a normal link */ diff --git a/soft-interface.c b/soft-interface.c index 14c9c40..28ffe34 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -34,7 +34,6 @@ #include <linux/ethtool.h> #include <linux/etherdevice.h> #include <linux/if_vlan.h> -#include "compat.h" #include "unicast.h" #include "routing.h"
diff --git a/translation-table.c b/translation-table.c index bb7063a..4b0a107 100644 --- a/translation-table.c +++ b/translation-table.c @@ -25,7 +25,6 @@ #include "types.h" #include "hash.h" #include "originator.h" -#include "compat.h"
static void hna_local_purge(struct work_struct *work); static void _hna_global_del_orig(struct bat_priv *bat_priv, diff --git a/vis.c b/vis.c index 5aea153..65676dc 100644 --- a/vis.c +++ b/vis.c @@ -27,7 +27,6 @@ #include "hard-interface.h" #include "hash.h" #include "originator.h" -#include "compat.h"
#define MAX_VIS_PACKET_SIZE 1000