Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: constify ieee80211_ie_build_{he,eht}_oper() chandef

The chandef parameter passed to ieee80211_ie_build_he_oper() and
ieee80211_ie_build_eht_oper is read-only. Since it is never modified,
add the const qualifier to this parameter. This makes these consistent
with ieee80211_ie_build_ht_oper() and ieee80211_ie_build_vht_oper().

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://patch.msgid.link/20240910-wireless-utils-constify-v1-1-e59947bcb3c3@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Jeff Johnson and committed by
Johannes Berg
2b73e9ab 5a4d42c1

+4 -4
+2 -2
net/mac80211/ieee80211_i.h
··· 2545 2545 u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, 2546 2546 const struct cfg80211_chan_def *chandef); 2547 2547 u8 ieee80211_ie_len_he_cap(struct ieee80211_sub_if_data *sdata); 2548 - u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef); 2549 - u8 *ieee80211_ie_build_eht_oper(u8 *pos, struct cfg80211_chan_def *chandef, 2548 + u8 *ieee80211_ie_build_he_oper(u8 *pos, const struct cfg80211_chan_def *chandef); 2549 + u8 *ieee80211_ie_build_eht_oper(u8 *pos, const struct cfg80211_chan_def *chandef, 2550 2550 const struct ieee80211_sta_eht_cap *eht_cap); 2551 2551 int ieee80211_parse_bitrates(enum nl80211_chan_width width, 2552 2552 const struct ieee80211_supported_band *sband,
+2 -2
net/mac80211/util.c
··· 2752 2752 return pos + sizeof(struct ieee80211_vht_operation); 2753 2753 } 2754 2754 2755 - u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef) 2755 + u8 *ieee80211_ie_build_he_oper(u8 *pos, const struct cfg80211_chan_def *chandef) 2756 2756 { 2757 2757 struct ieee80211_he_operation *he_oper; 2758 2758 struct ieee80211_he_6ghz_oper *he_6ghz_op; ··· 2844 2844 return pos; 2845 2845 } 2846 2846 2847 - u8 *ieee80211_ie_build_eht_oper(u8 *pos, struct cfg80211_chan_def *chandef, 2847 + u8 *ieee80211_ie_build_eht_oper(u8 *pos, const struct cfg80211_chan_def *chandef, 2848 2848 const struct ieee80211_sta_eht_cap *eht_cap) 2849 2849 2850 2850 {