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 <s...@narfation.org>
---
v3:
 - use __genl_const to keep it in ro memory for kernel >= 3.13
v2:
 - new patch
---
 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,
-- 
2.9.3

Reply via email to