Commit 591481cccbad trigger a warning:
In file included from ./include/net/genetlink.h:6,
from net/wireless/nl80211.c:25:
net/wireless/nl80211.c:692:69: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
692 | [NL80211_ATTR_TXQ_QUANTUM] = NLA_POLICY_FULL_RANGE(NLA_U32, &q_range),
| ^
./include/net/netlink.h:407:18: note: in definition of macro 'NLA_POLICY_FULL_RANGE'
407 | .range = _range, \
| ^~~~~~
Remove const qualifier to fix this.
Fixes: 591481cccbad ("wifi: cfg80211: restrict NL80211_ATTR_TXQ_QUANTUM values")
Signed-off-by: Yue Haibing <yuehaibing(a)huawei.com>
---
net/wireless/nl80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 89b94d482fcf..674a0d54aff8 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -403,7 +403,7 @@ nl80211_unsol_bcast_probe_resp_policy[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX +
.len = IEEE80211_MAX_DATA_LEN }
};
-static const struct netlink_range_validation q_range = {
+static struct netlink_range_validation q_range = {
.max = INT_MAX,
};
--
2.34.1