aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2023-10-25 09:22:04 -0700
committerJakub Kicinski <[email protected]>2023-10-26 16:24:09 -0700
commitea23fbd2a8f7dadfa9cd9b9d73f3b8a69eec0671 (patch)
tree947c27968803abfa32d76edf4fda8967d77423be /tools
parent5af8d8ce643478d754ef72fc239466f6ad0e2562 (diff)
netlink: make range pointers in policies const
struct nla_policy is usually constant itself, but unless we make the ranges inside constant we won't be able to make range structs const. The ranges are not modified by the core. Reviewed-by: Johannes Berg <[email protected]> Reviewed-by: David Ahern <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 0fee68863db4..31fd96f14fc0 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -2038,7 +2038,7 @@ def print_kernel_policy_ranges(family, cw):
first = False
sign = '' if attr.type[0] == 'u' else '_signed'
- cw.block_start(line=f'struct netlink_range_validation{sign} {c_lower(attr.enum_name)}_range =')
+ cw.block_start(line=f'static const struct netlink_range_validation{sign} {c_lower(attr.enum_name)}_range =')
members = []
if 'min' in attr.checks:
members.append(('min', attr.get_limit('min')))