The following commit has been merged in the next branch: commit 82fbef6da8a84e922100efa4caadf07c3526d719 Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Mon Oct 25 22:42:55 2010 +0000
batman-adv: Convert kbuild version check to preprocessor check
Makefile.kbuild includes a relative unreadable check for a version number to decide if we should compile bat_printk.c to get out own print implementations. This can easily be replaced using a simpler preprocessor check as we know them from compat.h
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/Makefile.kbuild b/Makefile.kbuild index 2a91716..7eba9f3 100644 --- a/Makefile.kbuild +++ b/Makefile.kbuild @@ -32,4 +32,20 @@ EXTRA_CFLAGS += -DREVISION_VERSION="$(REVISION)" endif
obj-m += batman-adv.o -batman-adv-y := main.o bat_debugfs.o bat_sysfs.o send.o routing.o soft-interface.o icmp_socket.o translation-table.o bitarray.o hash.o ring_buffer.o vis.o hard-interface.o aggregation.o originator.o unicast.o $(shell [ "2" -eq "$(VERSION)" ] 2>&- && [ "6" -eq "$(PATCHLEVEL)" ] 2>&- && [ "$(SUBLEVEL)" -le "28" ] 2>&- && echo bat_printk.o) +batman-adv-y += aggregation.o +batman-adv-y += bat_debugfs.o +batman-adv-y += bat_sysfs.o +batman-adv-y += bitarray.o +batman-adv-y += hard-interface.o +batman-adv-y += hash.o +batman-adv-y += icmp_socket.o +batman-adv-y += main.o +batman-adv-y += originator.o +batman-adv-y += ring_buffer.o +batman-adv-y += routing.o +batman-adv-y += send.o +batman-adv-y += soft-interface.o +batman-adv-y += translation-table.o +batman-adv-y += unicast.o +batman-adv-y += vis.o +batman-adv-y += bat_printk.o diff --git a/bat_printk.c b/bat_printk.c index 22cdda2..b0e732b 100644 --- a/bat_printk.c +++ b/bat_printk.c @@ -1,3 +1,7 @@ +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) + /* * linux/lib/vsprintf.c * @@ -952,3 +956,5 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...) m->count = m->size; return -1; } + +#endif /* < KERNEL_VERSION(2, 6, 29) */