Skip to content

Commit b980b31

Browse files
rikardfalkeborndavem330
authored andcommitted
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>
1 parent 674d3ab commit b980b31

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/openvswitch/conntrack.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info)
22312231
return err;
22322232
}
22332233

2234-
static struct genl_small_ops ct_limit_genl_ops[] = {
2234+
static const struct genl_small_ops ct_limit_genl_ops[] = {
22352235
{ .cmd = OVS_CT_LIMIT_CMD_SET,
22362236
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
22372237
.flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN

‎net/openvswitch/meter.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,
672672
return false;
673673
}
674674

675-
static struct genl_small_ops dp_meter_genl_ops[] = {
675+
static const struct genl_small_ops dp_meter_genl_ops[] = {
676676
{ .cmd = OVS_METER_CMD_FEATURES,
677677
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
678678
.flags = 0, /* OK for unprivileged users. */

0 commit comments

Comments
 (0)