diff mbox series

[RFC,2/2] net: netlink: constify full range pointers

Message ID 20230224134441.10dbceb0bdf1.Iaac3edac4a32e0c69b6c5de0e8e986f61a619cab@changeid (mailing list archive)
State RFC
Delegated to: Johannes Berg
Headers show
Series net: netlink: full range policy improvements | expand

Commit Message

Johannes Berg Feb. 24, 2023, 12:45 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

These pointers (and with them variables they point to)
really can be const, do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/netlink.h     | 4 ++--
 net/ipv6/ioam6_iptunnel.c | 2 +-
 net/wireless/nl80211.c    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/include/net/netlink.h b/include/net/netlink.h
index 52dedc8bfedd..6a4d6aae76bd 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -351,8 +351,8 @@  struct nla_policy {
 		const u32 mask;
 		const char *reject_message;
 		const struct nla_policy *nested_policy;
-		struct netlink_range_validation *range;
-		struct netlink_range_validation_signed *range_signed;
+		const struct netlink_range_validation *range;
+		const struct netlink_range_validation_signed *range_signed;
 		struct {
 			s16 min, max;
 		};
diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c
index 790a40e2497d..dd464d915ab8 100644
--- a/net/ipv6/ioam6_iptunnel.c
+++ b/net/ipv6/ioam6_iptunnel.c
@@ -46,7 +46,7 @@  struct ioam6_lwt {
 	struct ioam6_lwt_encap	tuninfo;
 };
 
-static struct netlink_range_validation freq_range = {
+static const struct netlink_range_validation freq_range = {
 	.min = IOAM6_IPTUNNEL_FREQ_MIN,
 	.max = IOAM6_IPTUNNEL_FREQ_MAX,
 };
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index fbea0e786b21..ae35b23fac73 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -462,7 +462,7 @@  nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] = {
 	[NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
 };
 
-static struct netlink_range_validation nl80211_punct_bitmap_range = {
+static const struct netlink_range_validation nl80211_punct_bitmap_range = {
 	.min = 0,
 	.max = 0xffff,
 };