b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Convert kbuild version check to preprocessor check
Date: Sun, 24 Oct 2010 01:15:46 +0200	[thread overview]
Message-ID: <1287875746-7644-1-git-send-email-sven.eckelmann@gmx.de> (raw)

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>
---
 batman-adv/Makefile.kbuild |    6 +++++-
 batman-adv/bat_printk.c    |    6 ++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/batman-adv/Makefile.kbuild b/batman-adv/Makefile.kbuild
index 14e3daa..40ca316 100644
--- a/batman-adv/Makefile.kbuild
+++ b/batman-adv/Makefile.kbuild
@@ -32,4 +32,8 @@ 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 bat_debugfs.o bat_sysfs.o bitarray.o \
+				gateway_client.o gateway_common.o hard-interface.o hash.o \
+				icmp_socket.o main.o originator.o ring_buffer.o routing.o \
+				send.o soft-interface.o translation-table.o unicast.o vis.o
+batman-adv-y += bat_printk.o
diff --git a/batman-adv/bat_printk.c b/batman-adv/bat_printk.c
index 4fa3e18..6bbeb8b 100644
--- a/batman-adv/bat_printk.c
+++ b/batman-adv/bat_printk.c
@@ -1,3 +1,7 @@
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+
 /*
  *  linux/lib/vsprintf.c
  *
@@ -935,3 +939,5 @@ int bat_snprintf(char *buf, size_t size, const char *fmt, ...)
 
 	return i;
 }
+
+#endif /* < KERNEL_VERSION(2, 6, 29) */
-- 
1.7.1


             reply	other threads:[~2010-10-23 23:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23 23:15 Sven Eckelmann [this message]
2010-10-25 22:42 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Convert kbuild version check to preprocessor check Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287875746-7644-1-git-send-email-sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).