All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] [batman-adv] Remove compatibility code for pre 2.6 kernel versions
@ 2009-09-12 10:12 Sven Eckelmann
  2009-09-12 16:56 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2009-09-12 10:12 UTC (permalink / raw)
  To: b.a.t.m.a.n

The earliest version of linux which is compatible to
batman-adv-kernelland is 2.6.20. Their are patches available in debian
for batman-adv-kernelland 0.1 to make it build against linux 2.6.15, but
they cannot be ported to current trunk due to changes to the working
queues. To have "support" for much older versions isn't needed and can
be removed without loosing any functionality.
As result the only remaining LINUX_VERSION_CODE dependend precomiler
code beside compat.h is for netdevice_ops support in soft-interface.c
and result code checking of unregister_chrdev in device.c. For a
possible merge into linux compat.h and all appearances of
LINUX_VERSION_CODE should be removed according to checkpatch.pl.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv-kernelland/device.c |   14 --------------
 batman-adv-kernelland/main.c   |    8 --------
 2 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/batman-adv-kernelland/device.c b/batman-adv-kernelland/device.c
index 80a6215..6383839 100644
--- a/batman-adv-kernelland/device.c
+++ b/batman-adv-kernelland/device.c
@@ -26,9 +26,7 @@
 
 #include "compat.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 static struct class *batman_class;
-#endif
 
 static int Major;	/* Major number assigned to our device driver */
 
@@ -65,13 +63,6 @@ int bat_device_setup(void)
 		return 0;
 	}
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-	if (devfs_mk_cdev(MKDEV(tmp_major, 0), S_IFCHR | S_IRUGO | S_IWUGO,
-			  "batman-adv", 0)) {
-		debug_log(LOG_TYPE_WARN, "Could not create /dev/batman-adv\n");
-		return 0;
-	}
-#else
 	batman_class = class_create(THIS_MODULE, "batman-adv");
 
 	if (IS_ERR(batman_class)) {
@@ -81,7 +72,6 @@ int bat_device_setup(void)
 
 	device_create(batman_class, NULL, MKDEV(tmp_major, 0), NULL,
 		      "batman-adv");
-#endif
 
 	Major = tmp_major;
 	return 1;
@@ -94,12 +84,8 @@ void bat_device_destroy(void)
 	if (!Major)
 		return;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-	devfs_remove("batman-adv", 0);
-#else
 	device_destroy(batman_class, MKDEV(Major, 0));
 	class_destroy(batman_class);
-#endif
 
 	/* Unregister the device */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 584b141..8fbefc2 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -203,20 +203,12 @@ void shutdown_module(void)
 
 void inc_module_count(void)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-	MOD_INC_USE_COUNT;
-#else
 	try_module_get(THIS_MODULE);
-#endif
 }
 
 void dec_module_count(void)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-	MOD_DEC_USE_COUNT;
-#else
 	module_put(THIS_MODULE);
-#endif
 }
 
 int addr_to_string(char *buff, uint8_t *addr)
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] [batman-adv] Remove compatibility code for pre 2.6 kernel versions
  2009-09-12 10:12 [B.A.T.M.A.N.] [PATCH] [batman-adv] Remove compatibility code for pre 2.6 kernel versions Sven Eckelmann
@ 2009-09-12 16:56 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2009-09-12 16:56 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Saturday 12 September 2009 18:12:44 Sven Eckelmann wrote:
> The earliest version of linux which is compatible to
> batman-adv-kernelland is 2.6.20. Their are patches available in debian
> for batman-adv-kernelland 0.1 to make it build against linux 2.6.15, but
> they cannot be ported to current trunk due to changes to the working
> queues. To have "support" for much older versions isn't needed and can
> be removed without loosing any functionality.

Thanks for the patch. Applied in r1436.

Regards,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-12 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-12 10:12 [B.A.T.M.A.N.] [PATCH] [batman-adv] Remove compatibility code for pre 2.6 kernel versions Sven Eckelmann
2009-09-12 16:56 ` Marek Lindner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.