[v2,15/26] batman-adv: iv_ogm_queue_add, Simplify expressions

Message ID 1419594103-10928-16-git-send-email-mpa@pengutronix.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Markus Pargmann Dec. 26, 2014, 11:41 a.m. UTC
  Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 bat_iv_ogm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Marek Lindner Feb. 24, 2015, 9:20 p.m. UTC | #1
On Friday, December 26, 2014 12:41:32 Markus Pargmann wrote:
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>  bat_iv_ogm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision 253a6dd.

Thanks,
Marek
  

Patch

diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 12185f985c79..8e29772ad8ae 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -750,13 +750,13 @@  static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv,
 	unsigned long max_aggregation_jiffies;
 
 	batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff;
-	direct_link = batadv_ogm_packet->flags & BATADV_DIRECTLINK ? 1 : 0;
+	direct_link = !!(batadv_ogm_packet->flags & BATADV_DIRECTLINK);
 	max_aggregation_jiffies = msecs_to_jiffies(BATADV_MAX_AGGREGATION_MS);
 
 	/* find position for the packet in the forward queue */
 	spin_lock_bh(&bat_priv->forw_bat_list_lock);
 	/* own packets are not to be aggregated */
-	if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) {
+	if (atomic_read(&bat_priv->aggregated_ogms) && !own_packet) {
 		hlist_for_each_entry(forw_packet_pos,
 				     &bat_priv->forw_bat_list, list) {
 			if (batadv_iv_ogm_can_aggregate(batadv_ogm_packet,