[v2] wifi: mac80211: tx: Add __must_hold() annotation

Message ID 20240113172719.40364-3-bpappas@pappasbrent.com
State New
Headers
Series [v2] wifi: mac80211: tx: Add __must_hold() annotation |

Commit Message

Brent Pappas Jan. 13, 2024, 5:27 p.m. UTC
  Annotates ieee80211_set_beacon_cntdwn() with a __must_hold() annotation to
make it clear that ieee80211_set_beacon_cntdwn() is only intended to be
called when the caller has a lock on the argument "link."

Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
---
Changelog:
v1 -> v2: Include linux/compiler_types.h with angle brackets instead of
          quotes.

 net/mac80211/tx.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 314998fdb1a5..ca7adace6a9c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -10,6 +10,7 @@ 
  * Transmit and frame generation functions.
  */
 
+#include <linux/compiler_types.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/skbuff.h>
@@ -4974,6 +4975,7 @@  static int ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
 static void ieee80211_set_beacon_cntdwn(struct ieee80211_sub_if_data *sdata,
 					struct beacon_data *beacon,
 					struct ieee80211_link_data *link)
+	__must_hold(link)
 {
 	u8 *beacon_data, count, max_count = 1;
 	struct probe_resp *resp;