[PATCH] batman-adv: use assign_bit() where applicable

From: Peng Fan (OSS)

Date: Sat Sep 19 2026 - 22:32:20 EST


From: Peng Fan <peng.fan@xxxxxxx>

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

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
net/batman-adv/distributed-arp-table.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index a4be5b2a87d7..74050bffedbc 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -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));
}

/**
--
2.51.0