Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit d4d360d4438da296ef98faf0b92084d3e71d575d Author: Sven Eckelmann sven@narfation.org Date: Tue Oct 18 15:57:36 2016 +0200
batman-adv: Mark batadv_netlink_ops as const
The genl_ops don't need to be written by anyone and thus can be moved in a ro memory range.
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich sw@simonwunderlich.de
d4d360d4438da296ef98faf0b92084d3e71d575d compat-patches/replacements.sh | 1 + net/batman-adv/netlink.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/compat-patches/replacements.sh b/compat-patches/replacements.sh index 669b0ff..7dcb953 100755 --- a/compat-patches/replacements.sh +++ b/compat-patches/replacements.sh @@ -5,4 +5,5 @@ set -e # for kernel < 3.13 to make netlink compat code work sed -i \ -e 's/^static const struct genl_multicast_group batadv_netlink_mcgrps/static __genl_const struct genl_multicast_group batadv_netlink_mcgrps/' \ + -e 's/^static const struct genl_ops batadv_netlink_ops/static __genl_const struct genl_ops batadv_netlink_ops/' \ build/net/batman-adv/netlink.c diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index 64cb6ac..aee20a3 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -534,7 +534,7 @@ batadv_netlink_dump_hardifs(struct sk_buff *msg, struct netlink_callback *cb) return msg->len; }
-static struct genl_ops batadv_netlink_ops[] = { +static const struct genl_ops batadv_netlink_ops[] = { { .cmd = BATADV_CMD_GET_MESH_INFO, .flags = GENL_ADMIN_PERM,