From patchwork Wed Apr 20 07:52:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 919 Return-Path: Received: from contumacia.investici.org (contumacia.investici.org [178.255.144.35]) by open-mesh.org (Postfix) with ESMTPS id EE826154248 for ; Wed, 20 Apr 2011 10:12:37 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 3A829E8109; Wed, 20 Apr 2011 09:53:01 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.6.0 contumacia.investici.org 3A829E8109 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1303285982; bh=zYAexHMRduLYp9BMAD8qJt8QmHp6praRtzHIjr FNCqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=rwq/ZCklfMSeQ/UenM8UQGUTUjXhXCPMnEWKduh3MTz3qR76FnCsMN1absYc30/Ae bM65gCa5Nu3fAztxG1HmowBbxvihNTaofvjUZNFZ2wMuLUssmOko5WXY7Ml+5BpPDPm yvcO9HpaLRgnsUaCh/AlPuh1btG1BAS+gHEq/x4= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Wed, 20 Apr 2011 09:52:56 +0200 Message-Id: <1303285976-28566-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1303282479-17392-1-git-send-email-ordex@autistici.org> References: <1303282479-17392-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: Move definition of atomic_dec_not_zero() into main.h X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2011 08:12:38 -0000 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 Acked-by: Sven Eckelmann --- 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. *