Staging: batman-adv: Remove compat.h
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Sat, 2 Jan 2010 10:30:51 +0000 (11:30 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:36 +0000 (16:42 -0800)
Since we are now part of mainline, we don't need compat.h to allow
building of the module with old versions of the kernel.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 files changed:
drivers/staging/batman-adv/TODO
drivers/staging/batman-adv/compat.h [deleted file]
drivers/staging/batman-adv/device.c
drivers/staging/batman-adv/hard-interface.c
drivers/staging/batman-adv/main.c
drivers/staging/batman-adv/originator.c
drivers/staging/batman-adv/proc.c
drivers/staging/batman-adv/routing.c
drivers/staging/batman-adv/send.c
drivers/staging/batman-adv/soft-interface.c
drivers/staging/batman-adv/translation-table.c
drivers/staging/batman-adv/vis.c

index 2122adc6aa84e28f8bb7b73fda6c957e96dab9ee..2f15136b18e793f2142ecde3f4489de95f239cfa 100644 (file)
@@ -17,9 +17,6 @@
 -> transtable_global (read-only) [outputs the global translation table]
 -> transtable_local (read-only) [outputs the local translation table]
 
-=> strip out all backward compatibility support to older kernels
-   (only found in compat.h)
-
 => fix checkpatch.pl errors
 
 Please send all patches to:
diff --git a/drivers/staging/batman-adv/compat.h b/drivers/staging/batman-adv/compat.h
deleted file mode 100644 (file)
index ded1e6e..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
- *
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#include <linux/version.h>     /* LINUX_VERSION_CODE */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
-
-#define skb_set_network_header(_skb, _offset) \
-       do { (_skb)->nh.raw = (_skb)->data + (_offset); } while (0)
-
-#define skb_reset_mac_header(_skb) \
-       do { (_skb)->mac.raw = (_skb)->data; } while (0)
-
-#define list_first_entry(ptr, type, member) \
-       list_entry((ptr)->next, type, member)
-
-#define skb_mac_header(_skb) \
-    ((_skb)->mac.raw)
-
-#define skb_network_header(_skb) \
-    ((_skb)->nh.raw)
-
-#define skb_mac_header(_skb) \
-    ((_skb)->mac.raw)
-
-#endif /* < KERNEL_VERSION(2,6,22) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
-
-static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
-{
-       /* skb->hdr_len not available, just "not writable" to enforce a copy */
-       return 0;
-}
-
-#define cancel_delayed_work_sync(wq) cancel_rearming_delayed_work(wq)
-
-#endif /* < KERNEL_VERSION(2, 6, 23) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
-
-#define strict_strtoul(cp, base, res) \
-       ({ \
-       int ret = 0; \
-       char *endp; \
-       *res = simple_strtoul(cp, &endp, base); \
-       if (cp == endp) \
-               ret = -EINVAL; \
-       ret; \
-})
-
-#endif /* < KERNEL_VERSION(2, 6, 25) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
-
-static const char hex_asc[] = "0123456789abcdef";
-#define hex_asc_lo(x)   hex_asc[((x) & 0x0f)]
-#define hex_asc_hi(x)   hex_asc[((x) & 0xf0) >> 4]
-static inline char *pack_hex_byte(char *buf, u8 byte)
-{
-    *buf++ = hex_asc_hi(byte);
-    *buf++ = hex_asc_lo(byte);
-    return buf;
-}
-
-#define device_create(_cls, _parent, _devt, _device, _fmt) \
-       class_device_create(_cls, _parent, _devt, _device, _fmt)
-
-#define device_destroy(_cls, _device) \
-       class_device_destroy(_cls, _device)
-
-#endif /* < KERNEL_VERSION(2, 6, 26) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
-
-#ifndef dereference_function_descriptor
-#define dereference_function_descriptor(p) (p)
-#endif
-
-#ifndef device_create
-#define device_create(_cls, _parent, _devt, _device, _fmt) \
-       device_create_drvdata(_cls, _parent, _devt, _device, _fmt)
-#endif
-
-#endif /* < KERNEL_VERSION(2, 6, 27) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
-
-asmlinkage int bat_printk(const char *fmt, ...);
-#define printk bat_printk
-
-static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
-{
-       if (dev->get_stats)
-               return dev->get_stats(dev);
-       else
-               return NULL;
-}
-
-#endif /* < KERNEL_VERSION(2, 6, 29) */
index 72306acec5e6a8e37086a73ed8a4a9e47911b637..a3e74296abfd47cb7e9dd5ddfdeaa7ff1a01df69 100644 (file)
@@ -26,8 +26,6 @@
 #include "types.h"
 #include "hash.h"
 
-#include "compat.h"
-
 static struct class *batman_class;
 
 static int Major;      /* Major number assigned to our device driver */
index db264bd0bf9d06e62ec0d4f267862857c9e9ab2c..f8b1ba3910ade77ec9fa55f5ad9d6debfa748795 100644 (file)
@@ -26,7 +26,6 @@
 #include "translation-table.h"
 #include "routing.h"
 #include "hash.h"
-#include "compat.h"
 
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
 
index 1d80ea366be3d8bf6174374e206289417074563a..3f780753a2bf83612f2cf0542f2dac3e712c4cd6 100644 (file)
@@ -31,7 +31,6 @@
 #include "types.h"
 #include "vis.h"
 #include "hash.h"
-#include "compat.h"
 
 struct list_head if_list;
 struct hlist_head forw_bat_list;
index a60dbe1cf6bf897fa8cf39f6a75b7f82126736b1..29c241119a3b146aed9339070cea30cde79bcfa4 100644 (file)
@@ -26,8 +26,6 @@
 #include "hash.h"
 #include "translation-table.h"
 #include "routing.h"
-#include "compat.h"
-
 
 static DECLARE_DELAYED_WORK(purge_orig_wq, purge_orig);
 
@@ -80,11 +78,10 @@ create_neighbor(struct orig_node *orig_node, struct orig_node *orig_neigh_node,
 
        bat_dbg(DBG_BATMAN, "Creating new last-hop neighbor of originator\n");
 
-       neigh_node = kmalloc(sizeof(struct neigh_node), GFP_ATOMIC);
+       neigh_node = kzalloc(sizeof(struct neigh_node), GFP_ATOMIC);
        if (!neigh_node)
                return NULL;
 
-       memset(neigh_node, 0, sizeof(struct neigh_node));
        INIT_LIST_HEAD(&neigh_node->list);
 
        memcpy(neigh_node->addr, neigh, ETH_ALEN);
@@ -131,11 +128,10 @@ struct orig_node *get_orig_node(uint8_t *addr)
 
        bat_dbg(DBG_BATMAN, "Creating new originator: %pM \n", addr);
 
-       orig_node = kmalloc(sizeof(struct orig_node), GFP_ATOMIC);
+       orig_node = kzalloc(sizeof(struct orig_node), GFP_ATOMIC);
        if (!orig_node)
                return NULL;
 
-       memset(orig_node, 0, sizeof(struct orig_node));
        INIT_LIST_HEAD(&orig_node->neigh_list);
 
        memcpy(orig_node->orig, addr, ETH_ALEN);
@@ -145,19 +141,15 @@ struct orig_node *get_orig_node(uint8_t *addr)
 
        size = num_ifs * sizeof(TYPE_OF_WORD) * NUM_WORDS;
 
-       orig_node->bcast_own = kmalloc(size, GFP_ATOMIC);
+       orig_node->bcast_own = kzalloc(size, GFP_ATOMIC);
        if (!orig_node->bcast_own)
                goto free_orig_node;
 
-       memset(orig_node->bcast_own, 0, size);
-
        size = num_ifs * sizeof(uint8_t);
-       orig_node->bcast_own_sum = kmalloc(size, GFP_ATOMIC);
+       orig_node->bcast_own_sum = kzalloc(size, GFP_ATOMIC);
        if (!orig_node->bcast_own_sum)
                goto free_bcast_own;
 
-       memset(orig_node->bcast_own_sum, 0, size);
-
        if (hash_add(orig_hash, orig_node) < 0)
                goto free_bcast_own_sum;
 
index 33dae941a5c9e7d687b6493d896a81c8aa1fa9c2..4d199351c2b4a404e36c2e8c729767c45dfe1c7b 100644 (file)
@@ -27,7 +27,6 @@
 #include "types.h"
 #include "hash.h"
 #include "vis.h"
-#include "compat.h"
 
 static struct proc_dir_entry *proc_batman_dir, *proc_interface_file;
 static struct proc_dir_entry *proc_orig_interval_file, *proc_originators_file;
index bab7a73e17a5ef407ccbeb635b9e97fefaa29b9c..09917e57b41c9f52cbb1ddce8b40fa365bc0e898 100644 (file)
@@ -32,7 +32,6 @@
 #include "ring_buffer.h"
 #include "vis.h"
 #include "aggregation.h"
-#include "compat.h"
 
 DECLARE_WAIT_QUEUE_HEAD(thread_wait);
 
@@ -310,7 +309,6 @@ static void update_orig(struct orig_node *orig_node, struct ethhdr *ethhdr,
 
 update_hna:
        update_routes(orig_node, orig_node->router, hna_buff, tmp_hna_buff_len);
-       return;
 }
 
 static char count_real_packets(struct ethhdr *ethhdr,
index edfdd5d9279b6c65f56984b6a4a362c87542d35e..944b2cdbdff821b955acc0a363855e766e35ee94 100644 (file)
@@ -29,8 +29,6 @@
 #include "vis.h"
 #include "aggregation.h"
 
-#include "compat.h"
-
 /* apply hop penalty for a normal link */
 static uint8_t hop_penalty(const uint8_t tq)
 {
index bc0217b1aeb1b7c6c63da96792e034debb4aa2e9..c9b35d9f799121774e3abe64a6c6789c60d0d39c 100644 (file)
@@ -28,7 +28,6 @@
 #include "hash.h"
 #include <linux/ethtool.h>
 #include <linux/etherdevice.h>
-#include "compat.h"
 
 static uint16_t bcast_seqno = 1; /* give own bcast messages seq numbers to avoid
                                  * broadcast storms */
@@ -120,7 +119,7 @@ void interface_setup(struct net_device *dev)
 
        /* generate random address */
        random_ether_addr(dev_addr);
-       memcpy(dev->dev_addr, dev_addr, sizeof(dev->dev_addr));
+       memcpy(dev->dev_addr, dev_addr, ETH_ALEN);
 
        SET_ETHTOOL_OPS(dev, &bat_ethtool_ops);
 
@@ -269,7 +268,7 @@ unlock:
 dropped:
        priv->stats.tx_dropped++;
 end:
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 void interface_rx(struct sk_buff *skb, int hdr_size)
@@ -338,7 +337,6 @@ static u32 bat_get_msglevel(struct net_device *dev)
 
 static void bat_set_msglevel(struct net_device *dev, u32 value)
 {
-       return;
 }
 
 static u32 bat_get_link(struct net_device *dev)
index 398a8084660ac44057c64da72d37490f6609614c..d56f6654de0d3156f74f55a3fd08f9784e12f78a 100644 (file)
@@ -24,7 +24,6 @@
 #include "soft-interface.h"
 #include "types.h"
 #include "hash.h"
-#include "compat.h"
 
 struct hashtable_t *hna_local_hash;
 static struct hashtable_t *hna_global_hash;
index 191297926b3fe92db4a487b82bf78b1fb65b5685..ec8bb3f382c616429bb833f47cedf1b91b854d88 100644 (file)
@@ -26,7 +26,6 @@
 #include "soft-interface.h"
 #include "hard-interface.h"
 #include "hash.h"
-#include "compat.h"
 
 struct hashtable_t *vis_hash;
 DEFINE_SPINLOCK(vis_hash_lock);
This page took 0.035284 seconds and 5 git commands to generate.