Skip to contentSkip to conversation

batman-adv: remove extra negation in gw_out_of_range()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 29, 2011 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: remove extra negation in gw_out_of_range()

There is a typo here where an extra '!' made the check to the opposite of what was intended.

net/batman-adv/gateway_client.c +1 -1
index 9373a14..24403a7 100644
@@ -695,7 +695,7 @@ bool gw_out_of_range(struct bat_priv *bat_priv,
 	}
 
 	neigh_old = find_router(bat_priv, orig_dst_node, NULL);
-	if (!!neigh_old)
+	if (!neigh_old)
 		goto out;
 
 	if (curr_tq_avg - neigh_old->tq_avg > GW_THRESHOLD)

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 10 lines · On Tuesday, November 29, 2011 14:09:09 Dan Carpenter wrote:

There is a typo here where an extra '!' made the check to the opposite of what was intended.

(quoted diff) +0 -0

b/net/batman-adv/gateway_client.c index 9373a14..24403a7 100644

net/batman-adv/gateway_client.c bool gw_out_of_range(struct bat_priv *bat_priv, · line 701

Quoted 8 lines
net/batman-adv/gateway_client.c +1 -1
@@ -695,7 +695,7 @@ bool gw_out_of_range(struct bat_priv *bat_priv,
 	}
 
 	neigh_old = find_router(bat_priv, orig_dst_node, NULL);
-	if (!!neigh_old)
+	if (!neigh_old)
 		goto out;
 
 	if (curr_tq_avg - neigh_old->tq_avg > GW_THRESHOLD)

Wow - you are right! Applied in our tree.

Thanks,
Marek