The following commit has been merged in the master branch: commit 6336988932cae06a632f1534b6dbf4106acfc178 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 14e3daa..e99c198 100644 --- a/Makefile.kbuild +++ b/Makefile.kbuild @@ -32,4 +32,22 @@ 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 gateway_common.o gateway_client.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 += gateway_client.o +batman-adv-y += gateway_common.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 69a7f95..f4561c3 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 * @@ -953,3 +957,5 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...) m->count = m->size; return -1; } + +#endif /* < KERNEL_VERSION(2, 6, 29) */