Skip to contentSkip to conversation

batman-adv: use assign_bit() where applicable

PATCH Applied Peng Fan (OSS) 2 participants 2 messages Sep 20 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: use assign_bit() where applicable

From: Peng Fan <[email protected]>

Convert open-coded if/else with set_bit/clear_bit the assign_bit API.

---
 net/batman-adv/distributed-arp-table.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/batman-adv/distributed-arp-table.c +2 -4
index a4be5b2a87d7..74050bffedbc 100644
@@ -863,10 +863,8 @@ static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 					   u8 flags,
 					   void *tvlv_value, u16 tvlv_value_len)
 {
-	if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND)
-		clear_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
-	else
-		set_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
+	assign_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities,
+		   !(flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND));
 }
 
 /**
Signature · 1 line
2.51.0