net: openvswitch: Constify static struct genl_small_ops

The only usage of these is to assign their address to the small_ops field
in the genl_family struct, which is a const pointer, and applying
ARRAY_SIZE() on them. Make them const to allow the compiler to put them
in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Rikard Falkeborn 2020-10-05 01:44:17 +02:00 committed by David S. Miller
parent 674d3ab949
commit b980b313e5
2 changed files with 2 additions and 2 deletions

View File

@ -2231,7 +2231,7 @@ exit_err:
return err;
}
static struct genl_small_ops ct_limit_genl_ops[] = {
static const struct genl_small_ops ct_limit_genl_ops[] = {
{ .cmd = OVS_CT_LIMIT_CMD_SET,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN

View File

@ -672,7 +672,7 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
return false;
}
static struct genl_small_ops dp_meter_genl_ops[] = {
static const struct genl_small_ops dp_meter_genl_ops[] = {
{ .cmd = OVS_METER_CMD_FEATURES,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.flags = 0, /* OK for unprivileged users. */