]> git.ipfire.org Git - thirdparty/linux.git/commit
batman-adv: use atomic_xchg() for gw.reselect check
authorSven Eckelmann <sven@narfation.org>
Tue, 12 May 2026 20:03:53 +0000 (22:03 +0200)
committerSven Eckelmann <sven@narfation.org>
Fri, 29 May 2026 19:19:21 +0000 (21:19 +0200)
commit9550dd11e360ec0c460b13096ceda283601fa5cb
tree4b75e07d1898c65e683359498c5545397e260850
parentb8fbbfe81d3e9678290923f374d700aa03fa8d4e
batman-adv: use atomic_xchg() for gw.reselect check

batadv_gw_election() only needs to test whether gw.reselect was set and
clear it afterwards. Replace the batadv_atomic_dec_not_zero()
[atomic_add_unless(..., -1, 0)] call with atomic_xchg(..., 0) to simplify
the logic and make the intent more explicit.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_client.c