batman-adv: Move definition of atomic_dec_not_zero() into main.h
authorAntonio Quartulli <ordex@autistici.org>
Wed, 20 Apr 2011 07:52:56 +0000 (09:52 +0200)
committerSven Eckelmann <sven@narfation.org>
Sun, 1 May 2011 20:49:03 +0000 (22:49 +0200)
atomic_dec_not_zero() is very useful and it is currently defined
multiple times. So it is possible to move it in main.h

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/aggregation.c
net/batman-adv/main.h
net/batman-adv/send.c

index af45d6b2031f978d208aa6cde1dbef6fb93b8b4c..c11788c4c1a1ea49ff5127bb8fb883a8968a5538 100644 (file)
@@ -95,7 +95,6 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
        return false;
 }
 
-#define atomic_dec_not_zero(v)          atomic_add_unless((v), -1, 0)
 /* create a new aggregated packet and add this packet to it */
 static void new_aggregated_packet(unsigned char *packet_buff, int packet_len,
                                  unsigned long send_time, bool direct_link,
index dc248697de71591c317cf7f7b032e743877a3d96..ace72852ed7bbf2bbbe6e6276fce22550a28607a 100644 (file)
@@ -175,4 +175,6 @@ static inline int compare_eth(void *data1, void *data2)
        return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
 }
 
+#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
+
 #endif /* _NET_BATMAN_ADV_MAIN_H_ */
index e78670c3c4b73abf85c474a7a590ebbb1cb494de..7650e2bf187d23fef8f8978b510520764b77245b 100644 (file)
@@ -393,7 +393,6 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
                           send_time);
 }
 
-#define atomic_dec_not_zero(v)          atomic_add_unless((v), -1, 0)
 /* add a broadcast packet to the queue and setup timers. broadcast packets
  * are sent multiple times to increase probability for beeing received.
  *