Skip to contentSkip to conversation

batman-adv:Make the function batadv_is_my_mac bool

PATCH NAK Nicholas Krause 2 participants 3 messages Jun 11, 2015 1 message not in the archive

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

PATCH 1/1 batman-adv:Make the function batadv_is_my_mac bool

This makes the function batadv_is_my_mac bool now due to this particular function only returning either one or zero as its return value.

---
 net/batman-adv/main.c | 6 +++---
 net/batman-adv/main.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
net/batman-adv/main.c +3 -3
index 12fc77b..47051d1 100644
@@ -210,7 +210,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
  * @bat_priv: the bat priv with all the soft interface information
  * @addr: the address to check
  */
-int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
+bool batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
 {
 	const struct batadv_hard_iface *hard_iface;
 
@@ -224,11 +224,11 @@ int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
 
 		if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
 			rcu_read_unlock();
-			return 1;
+			return true;
 		}
 	}
 	rcu_read_unlock();
-	return 0;
+	return false;
 }
 
 /**
net/batman-adv/main.h +1 -1
index 4d23188..8f6e256 100644
@@ -195,7 +195,7 @@ extern struct workqueue_struct *batadv_event_workqueue;
 
 int batadv_mesh_init(struct net_device *soft_iface);
 void batadv_mesh_free(struct net_device *soft_iface);
-int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
+bool batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
 struct batadv_hard_iface *
 batadv_seq_print_text_primary_if_get(struct seq_file *seq);
 int batadv_max_header_len(void);
Signature · 1 line
2.1.4
#1 lore raw

Nicholas,

Quoted 5 lines · Nicholas Krause

This makes the function batadv_is_my_mac bool now due to this particular function only returning either one or zero as its return value.

NAK.

we already have ("batman-adv: main, Convert is_my_mac() to bool") in net-next that does exactly the same. I guess you did not pull the latest changes before writing this patch?

Cheers,

Signature · 1 line
Antonio Quartulli
#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · Antonio Quartulli

Nicholas,

Quoted 5 lines · Nicholas Krause

This makes the function batadv_is_my_mac bool now due to this particular function only returning either one or zero as its return value.

Quoted 8 lines

NAK.

we already have ("batman-adv: main, Convert is_my_mac() to bool") in net-next that does exactly the same. I guess you did not pull the latest
changes before writing this patch?

Cheers,

I was basing this patch off Linux's tree,
that's why.
Nick

Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.