From patchwork Thu Jun 9 15:13:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1156 Return-Path: Received: from nm5.bullet.mail.ukl.yahoo.com (nm5.bullet.mail.ukl.yahoo.com [217.146.182.226]) by open-mesh.org (Postfix) with SMTP id 53FE515441F for ; Thu, 9 Jun 2011 17:14:39 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.212] by nm5.bullet.mail.ukl.yahoo.com with NNFMP; 09 Jun 2011 15:14:38 -0000 Received: from [77.238.184.72] by tm5.bullet.mail.ukl.yahoo.com with NNFMP; 09 Jun 2011 15:14:38 -0000 Received: from [127.0.0.1] by smtp141.mail.ukl.yahoo.com with NNFMP; 09 Jun 2011 15:14:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1307632478; bh=uqqxN1a+5oWP0ikkGaCcDcA3Ar91jXMgyUzJ4iAqI1s=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer; b=X7DWaHfZ9RuXLsad7G+Va96eN2GnaHF1OtqIQxbazy4+umutLf5MFAQC/jinL7RnZbVpTArBmQiztP5C8UwrDWQHBoVHExyoaJ3/FJFPYM1hr8+XKnlqYFCMKXe6KgqLu77xqdVCjP5w8ZXjHX1Qt3PvgKQ6jXXruEDTh8PLIj0= X-Yahoo-Newman-Id: 442848.31370.bm@smtp141.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: X3gnfKEVM1kER7fccvXLWwDInE8fs9lvuzKzXchiYHAuXIu .9UKA6_xDdGxjhpUSZbILFlxqm5gqkvRDSsTz3Y5WnBHEiS0XheeIqGXRPGk e8GLGPBo3fPlyN0KS8K2bpFou0sudl5AjXx1EgOyV5EkfpQzYc.GKy0Ui3yv iAuawOFaL4_VXMsuoD5sPuMPmChmFqSJbare1t.P2ncQ7PShFiXKnZLwm1ak RKBPAns1rWW5pI_TTHXUn3WpwxidtVnPF_zUJjfv8gk9KlyFMJYGuQ4LpSzR YSjBzpzi1d2wP_SjF4nuUSj1X_PRhUh8zdyYOkmS2s1prAW2uvn3orQ-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@90.35.102.28 with plain) by smtp141.mail.ukl.yahoo.com with SMTP; 09 Jun 2011 15:14:38 +0000 GMT From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 9 Jun 2011 17:13:09 +0200 Message-Id: <1307632389-31676-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.3 Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: use NO_FLAGS define instead of hard-coding 0 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: Thu, 09 Jun 2011 15:14:39 -0000 The definition NO_FLAGS was introduced to make the code more readable and shall be used to initialize flag fields. Signed-off-by: Marek Lindner Acked-by: Sven Eckelmann --- aggregation.c | 2 +- gateway_client.c | 4 ++-- hard-interface.c | 2 +- send.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aggregation.c b/aggregation.c index ef26011..ede0a56 100644 --- a/aggregation.c +++ b/aggregation.c @@ -146,7 +146,7 @@ static void new_aggregated_packet(const unsigned char *packet_buff, forw_packet_aggr->own = own_packet; forw_packet_aggr->if_incoming = if_incoming; forw_packet_aggr->num_packets = 0; - forw_packet_aggr->direct_link_flags = 0; + forw_packet_aggr->direct_link_flags = NO_FLAGS; forw_packet_aggr->send_time = send_time; /* save packet direct link flag status */ diff --git a/gateway_client.c b/gateway_client.c index cf7f95e..24aee56 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -322,7 +322,7 @@ void gw_node_update(struct bat_priv *bat_priv, gw_node->deleted = 0; - if (new_gwflags == 0) { + if (new_gwflags == NO_FLAGS) { gw_node->deleted = jiffies; bat_dbg(DBG_BATMAN, bat_priv, "Gateway %pM removed from gateway list\n", @@ -335,7 +335,7 @@ void gw_node_update(struct bat_priv *bat_priv, goto unlock; } - if (new_gwflags == 0) + if (new_gwflags == NO_FLAGS) goto unlock; gw_node_add(bat_priv, orig_node, new_gwflags); diff --git a/hard-interface.c b/hard-interface.c index cf972c3..db7aacf 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -331,7 +331,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface, batman_packet = (struct batman_packet *)(hard_iface->packet_buff); batman_packet->packet_type = BAT_PACKET; batman_packet->version = COMPAT_VERSION; - batman_packet->flags = 0; + batman_packet->flags = NO_FLAGS; batman_packet->ttl = 2; batman_packet->tq = TQ_MAX_VALUE; batman_packet->tt_num_changes = 0; diff --git a/send.c b/send.c index 0c5d671..a150c7c 100644 --- a/send.c +++ b/send.c @@ -334,7 +334,7 @@ void schedule_own_packet(struct hard_iface *hard_iface) batman_packet->gw_flags = (uint8_t)atomic_read(&bat_priv->gw_bandwidth); else - batman_packet->gw_flags = 0; + batman_packet->gw_flags = NO_FLAGS; atomic_inc(&hard_iface->seqno);