The following commit has been merged in the master branch:
commit bf2326ed1b2a11070a332208c502868cb2ec77a4
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 21 14:28:05 2011 +0200
batctl: Remove optimisation and debugging options
Distributions like Gentoo or Debian have to strip the options regarding
the optimisation levels and debugging information to fulfil their
policies. There is currently no valid reason why the Makefile should
override it.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index 217a00a..3b9e853 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ endif
endif
CC = gcc
-CFLAGS += -pedantic -Wall -W -g3 -std=gnu99 -Os -fno-strict-aliasing
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing
EXTRA_CFLAGS = -DREVISION_VERSION=$(REVISION_VERSION)
LDFLAGS += -lm
--
batctl
The following commit has been merged in the master branch:
commit 8f8ca0591a4ae207a7d34ae1875a58c768007cb0
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed May 18 16:47:23 2011 +0200
batman-adv: a multiline comment should precede the variable it is describing
This comment has been wrongly put after the variable it refers to and was also bad indented
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/types.h b/types.h
index fab70e8..65b3222 100644
--- a/types.h
+++ b/types.h
@@ -246,10 +246,10 @@ struct frag_packet_list_entry {
};
struct vis_info {
- unsigned long first_seen;
- struct list_head recv_list;
- /* list of server-neighbors we received a vis-packet
- * from. we should not reply to them. */
+ unsigned long first_seen;
+ /* list of server-neighbors we received a vis-packet
+ * from. we should not reply to them. */
+ struct list_head recv_list;
struct list_head send_list;
struct kref refcount;
struct hlist_node hash_entry;
--
batman-adv
The following commit has been merged in the master branch:
commit fe2a2e427da3764070b5a4d814484a3047be00cb
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat May 21 01:33:07 2011 +0200
batman-adv: use is_broadcast_ether_addr() instead of compare_eth(.., brd_addr)
Instead of comparing mac addresses with the broadcast address by means
of compare_eth(), the is_broadcast_ether_addr() kernel function has to be
used.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/routing.c b/routing.c
index 07f23ba..90ae6f0 100644
--- a/routing.c
+++ b/routing.c
@@ -661,7 +661,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr,
hard_iface->net_dev->dev_addr))
is_my_oldorig = 1;
- if (compare_eth(ethhdr->h_source, broadcast_addr))
+ if (is_broadcast_ether_addr(ethhdr->h_source))
is_broadcast = 1;
}
rcu_read_unlock();
--
batman-adv
The following commit has been merged in the master branch:
commit 288421eda7806d1dbbecd0893e07611b6c75b485
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Thu May 19 21:43:08 2011 +0200
batman-adv: Check type of x and y in seq_(before|after)
seq_before and seq_after depend on the fact that both sequence numbers
have the same type and thus the same bitwidth. We can ensure that by
compile time checking using a compare between the pointer to the
temporary buffers which were created using the typeof of both
parameters. For example gcc would create a warning like
"warning: comparison of distinct pointer types lacks a cast".
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/main.h b/main.h
index db29444..3395bf9 100644
--- a/main.h
+++ b/main.h
@@ -196,8 +196,11 @@ static inline int compare_eth(const void *data1, const void *data2)
* - before adding more than 127 to the starting value - it is a predecessor,
* - when adding 128 - it is neither a predecessor nor a successor,
* - after adding more than 127 to the starting value - it is a successor */
-#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
- _dummy > smallest_signed_int(_dummy); })
+#define seq_before(x, y) ({typeof(x) _d1 = (x); \
+ typeof(y) _d2 = (y); \
+ typeof(x) _dummy = (_d1 - _d2); \
+ (void) (&_d1 == &_d2); \
+ _dummy > smallest_signed_int(_dummy); })
#define seq_after(x, y) seq_before(y, x)
#endif /* _NET_BATMAN_ADV_MAIN_H_ */
--
batman-adv
The following commit has been merged in the master branch:
commit 7962ae7cc6e3e5709dcc9189952ba3a81a931eea
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed May 18 09:20:50 2011 +0200
batman-adv: move smallest_signed_int(), seq_before() and seq_after() into main.h
smallest_signed_int(), seq_before() and seq_after() are very useful
functions that help to handle comparisons between sequence numbers.
However they were only defined in vis.c. With this patch every
batman-adv function will be able to use them.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/main.h b/main.h
index bf681eb..db29444 100644
--- a/main.h
+++ b/main.h
@@ -184,4 +184,20 @@ static inline int compare_eth(const void *data1, const void *data2)
#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
+/* Returns the smallest signed integer in two's complement with the sizeof x */
+#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
+
+/* Checks if a sequence number x is a predecessor/successor of y.
+ * they handle overflows/underflows and can correctly check for a
+ * predecessor/successor unless the variable sequence number has grown by
+ * more then 2**(bitwidth(x)-1)-1.
+ * This means that for a uint8_t with the maximum value 255, it would think:
+ * - when adding nothing - it is neither a predecessor nor a successor
+ * - before adding more than 127 to the starting value - it is a predecessor,
+ * - when adding 128 - it is neither a predecessor nor a successor,
+ * - after adding more than 127 to the starting value - it is a successor */
+#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
+ _dummy > smallest_signed_int(_dummy); })
+#define seq_after(x, y) seq_before(y, x)
+
#endif /* _NET_BATMAN_ADV_MAIN_H_ */
diff --git a/vis.c b/vis.c
index ea8d7e9..355c6e5 100644
--- a/vis.c
+++ b/vis.c
@@ -30,22 +30,6 @@
#define MAX_VIS_PACKET_SIZE 1000
-/* Returns the smallest signed integer in two's complement with the sizeof x */
-#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
-
-/* Checks if a sequence number x is a predecessor/successor of y.
- * they handle overflows/underflows and can correctly check for a
- * predecessor/successor unless the variable sequence number has grown by
- * more then 2**(bitwidth(x)-1)-1.
- * This means that for a uint8_t with the maximum value 255, it would think:
- * - when adding nothing - it is neither a predecessor nor a successor
- * - before adding more than 127 to the starting value - it is a predecessor,
- * - when adding 128 - it is neither a predecessor nor a successor,
- * - after adding more than 127 to the starting value - it is a successor */
-#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
- _dummy > smallest_signed_int(_dummy); })
-#define seq_after(x, y) seq_before(y, x)
-
static void start_vis_timer(struct bat_priv *bat_priv);
/* free the info */
--
batman-adv
The following commit has been merged in the next branch:
commit 178a37e6f4bb08a6de1b573a71c80d9746c3e09b
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Tue May 10 09:17:00 2011 +0200
batman-adv: convert call_rcu(neigh_node_free_rcu) to kfree()
The RCU callback neigh_node_free_rcu() just calls kfree(), so we can use
kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/originator.c b/originator.c
index 080ec88..40a30bb 100644
--- a/originator.c
+++ b/originator.c
@@ -54,18 +54,10 @@ err:
return 0;
}
-static void neigh_node_free_rcu(struct rcu_head *rcu)
-{
- struct neigh_node *neigh_node;
-
- neigh_node = container_of(rcu, struct neigh_node, rcu);
- kfree(neigh_node);
-}
-
void neigh_node_free_ref(struct neigh_node *neigh_node)
{
if (atomic_dec_and_test(&neigh_node->refcount))
- call_rcu(&neigh_node->rcu, neigh_node_free_rcu);
+ kfree_rcu(neigh_node, rcu);
}
/* increases the refcounter of a found router */
--
batman-adv
The following commit has been merged in the next branch:
commit 9f517fb32712a43cd726f57865853c8785be9434
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Tue May 10 09:16:59 2011 +0200
batman-adv: convert call_rcu(gw_node_free_rcu) to kfree_rcu
The RCU callback gw_node_free_rcu() just calls kfree(), so we can use
kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/gateway_client.c b/gateway_client.c
index 65f3953..61605a0 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -29,18 +29,10 @@
#include <linux/udp.h>
#include <linux/if_vlan.h>
-static void gw_node_free_rcu(struct rcu_head *rcu)
-{
- struct gw_node *gw_node;
-
- gw_node = container_of(rcu, struct gw_node, rcu);
- kfree(gw_node);
-}
-
static void gw_node_free_ref(struct gw_node *gw_node)
{
if (atomic_dec_and_test(&gw_node->refcount))
- call_rcu(&gw_node->rcu, gw_node_free_rcu);
+ kfree_rcu(gw_node, rcu);
}
static struct gw_node *gw_get_selected_gw_node(struct bat_priv *bat_priv)
--
batman-adv
The following commit has been merged in the next branch:
commit 8bd9620303eee333e3915853ca64e722c57495dd
Author: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Date: Tue May 10 09:17:01 2011 +0200
batman-adv: convert call_rcu(softif_neigh_free_rcu) to kfree_rcu
The RCU callback softif_neigh_free_rcu() just calls kfree(), so we can
use kfree_rcu() instead of call_rcu().
Signed-off-by: Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
Cc: Marek Lindner <lindner_marek(a)yahoo.de>
Cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Acked-by: David S. Miller <davem(a)davemloft.net>
Reviewed-by: Josh Triplett <josh(a)joshtriplett.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/soft-interface.c b/soft-interface.c
index c76a33e..d5aa609 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -72,18 +72,10 @@ int my_skb_head_push(struct sk_buff *skb, unsigned int len)
return 0;
}
-static void softif_neigh_free_rcu(struct rcu_head *rcu)
-{
- struct softif_neigh *softif_neigh;
-
- softif_neigh = container_of(rcu, struct softif_neigh, rcu);
- kfree(softif_neigh);
-}
-
static void softif_neigh_free_ref(struct softif_neigh *softif_neigh)
{
if (atomic_dec_and_test(&softif_neigh->refcount))
- call_rcu(&softif_neigh->rcu, softif_neigh_free_rcu);
+ kfree_rcu(softif_neigh, rcu);
}
static void softif_neigh_vid_free_rcu(struct rcu_head *rcu)
--
batman-adv