b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Move definition of atomic_dec_not_zero() into main.h
@ 2011-04-20  6:54 Antonio Quartulli
  2011-04-20  7:09 ` Sven Eckelmann
  2011-04-20  7:52 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Quartulli @ 2011-04-20  6:54 UTC (permalink / raw)
  To: B.A.T.M.A.N

atomic_dec_not_zero() is very usefull and it is currently defined
multiple times. So it is possible to move it in main.h
---
 aggregation.c |    1 -
 main.h        |    2 ++
 send.c        |    1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/aggregation.c b/aggregation.c
index af45d6b..c11788c 100644
--- a/aggregation.c
+++ b/aggregation.c
@@ -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,
diff --git a/main.h b/main.h
index a0059dd..101d9dc 100644
--- a/main.h
+++ b/main.h
@@ -177,4 +177,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_ */
diff --git a/send.c b/send.c
index e78670c..7650e2b 100644
--- a/send.c
+++ b/send.c
@@ -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.
  *
-- 
1.7.3.4


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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Move definition of atomic_dec_not_zero() into main.h
  2011-04-20  6:54 [B.A.T.M.A.N.] [PATCH] batman-adv: Move definition of atomic_dec_not_zero() into main.h Antonio Quartulli
@ 2011-04-20  7:09 ` Sven Eckelmann
  2011-04-20  7:52 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
  1 sibling, 0 replies; 4+ messages in thread
From: Sven Eckelmann @ 2011-04-20  7:09 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: Text/Plain, Size: 315 bytes --]

On Wednesday 20 April 2011 08:54:39 Antonio Quartulli wrote:
> atomic_dec_not_zero() is very usefull and it is currently defined
> multiple times. So it is possible to move it in main.h

I would prefer "useful" and a "Signed-off-by:" line.

For the rest of the patch:

Acked-by: Sven Eckelmann <sven@narfation.org>

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [B.A.T.M.A.N.] [PATCHv2] batman-adv: Move definition of atomic_dec_not_zero() into main.h
  2011-04-20  6:54 [B.A.T.M.A.N.] [PATCH] batman-adv: Move definition of atomic_dec_not_zero() into main.h Antonio Quartulli
  2011-04-20  7:09 ` Sven Eckelmann
@ 2011-04-20  7:52 ` Antonio Quartulli
  2011-04-20 11:13   ` Marek Lindner
  1 sibling, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2011-04-20  7:52 UTC (permalink / raw)
  To: B.A.T.M.A.N

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>
Acked-by: Sven Eckelmann <sven@narfation.org>
---
 aggregation.c |    1 -
 main.h        |    2 ++
 send.c        |    1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/aggregation.c b/aggregation.c
index af45d6b..c11788c 100644
--- a/aggregation.c
+++ b/aggregation.c
@@ -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,
diff --git a/main.h b/main.h
index a0059dd..101d9dc 100644
--- a/main.h
+++ b/main.h
@@ -177,4 +177,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_ */
diff --git a/send.c b/send.c
index e78670c..7650e2b 100644
--- a/send.c
+++ b/send.c
@@ -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.
  *
-- 
1.7.3.4


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

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: Move definition of atomic_dec_not_zero() into main.h
  2011-04-20  7:52 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
@ 2011-04-20 11:13   ` Marek Lindner
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2011-04-20 11:13 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Wednesday 20 April 2011 09:52:56 Antonio Quartulli wrote:
> 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>
> Acked-by: Sven Eckelmann <sven@narfation.org>

Applied in revision f9d05e.

Thanks,
Marek

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

end of thread, other threads:[~2011-04-20 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20  6:54 [B.A.T.M.A.N.] [PATCH] batman-adv: Move definition of atomic_dec_not_zero() into main.h Antonio Quartulli
2011-04-20  7:09 ` Sven Eckelmann
2011-04-20  7:52 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
2011-04-20 11:13   ` Marek Lindner

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).