]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
genetlink: mark families as __ro_after_init
authorJohannes Berg <johannes.berg@intel.com>
Mon, 24 Oct 2016 12:40:05 +0000 (14:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Oct 2016 20:16:09 +0000 (16:16 -0400)
Now genl_register_family() is the only thing (other than the
users themselves, perhaps, but I didn't find any doing that)
writing to the family struct.

In all families that I found, genl_register_family() is only
called from __init functions (some indirectly, in which case
I've add __init annotations to clarifly things), so all can
actually be marked __ro_after_init.

This protects the data structure from accidental corruption.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
35 files changed:
drivers/acpi/event.c
drivers/net/gtp.c
drivers/net/macsec.c
drivers/net/team/team.c
drivers/net/wireless/mac80211_hwsim.c
drivers/scsi/pmcraid.c
drivers/target/target_core_user.c
drivers/thermal/thermal_core.c
fs/dlm/netlink.c
fs/quota/netlink.c
include/linux/genl_magic_func.h
kernel/taskstats.c
net/batman-adv/netlink.c
net/core/devlink.c
net/core/drop_monitor.c
net/hsr/hsr_netlink.c
net/ieee802154/netlink.c
net/ieee802154/nl802154.c
net/ipv4/fou.c
net/ipv4/tcp_metrics.c
net/ipv6/ila/ila_xlat.c
net/irda/irnetlink.c
net/l2tp/l2tp_netlink.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netlabel/netlabel_calipso.c
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/netlink/genetlink.c
net/nfc/netlink.c
net/openvswitch/datapath.c
net/tipc/netlink.c
net/tipc/netlink_compat.c
net/wimax/stack.c
net/wireless/nl80211.c

index 1ab12ad7d5ba76e1fe64bd4dff46cfebd7bcb850..7fceb3b4691b0f5d4b42043d42ec422a60319051 100644 (file)
@@ -82,7 +82,7 @@ static const struct genl_multicast_group acpi_event_mcgrps[] = {
        { .name = ACPI_GENL_MCAST_GROUP_NAME, },
 };
 
-static struct genl_family acpi_event_genl_family = {
+static struct genl_family acpi_event_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .name = ACPI_GENL_FAMILY_NAME,
        .version = ACPI_GENL_VERSION,
@@ -144,7 +144,7 @@ int acpi_bus_generate_netlink_event(const char *device_class,
 
 EXPORT_SYMBOL(acpi_bus_generate_netlink_event);
 
-static int acpi_event_genetlink_init(void)
+static int __init acpi_event_genetlink_init(void)
 {
        return genl_register_family(&acpi_event_genl_family);
 }
index 0604fd78f8261f9e7920c29d4a193073a7be0596..719d19f35673fb4235df4cd2254347410a5b2d22 100644 (file)
@@ -1290,7 +1290,7 @@ static const struct genl_ops gtp_genl_ops[] = {
        },
 };
 
-static struct genl_family gtp_genl_family = {
+static struct genl_family gtp_genl_family __ro_after_init = {
        .name           = "gtp",
        .version        = 0,
        .hdrsize        = 0,
index 63ca7a3c77cf6e8d45a585f298d31c8e76e41f1a..0a715ab9d9cc6cd55a34bf6161e2395e6fc71a7c 100644 (file)
@@ -2648,7 +2648,7 @@ static const struct genl_ops macsec_genl_ops[] = {
        },
 };
 
-static struct genl_family macsec_fam = {
+static struct genl_family macsec_fam __ro_after_init = {
        .name           = MACSEC_GENL_NAME,
        .hdrsize        = 0,
        .version        = MACSEC_GENL_VERSION,
index 46bf7c1216c029179ec27e289cad046ac4871279..bdc58567d10e7b370b6966c35251b81619f314ce 100644 (file)
@@ -2740,7 +2740,7 @@ static const struct genl_multicast_group team_nl_mcgrps[] = {
        { .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, },
 };
 
-static struct genl_family team_nl_family = {
+static struct genl_family team_nl_family __ro_after_init = {
        .name           = TEAM_GENL_NAME,
        .version        = TEAM_GENL_VERSION,
        .maxattr        = TEAM_ATTR_MAX,
@@ -2773,7 +2773,7 @@ static int team_nl_send_event_port_get(struct team *team,
                                          port);
 }
 
-static int team_nl_init(void)
+static int __init team_nl_init(void)
 {
        return genl_register_family(&team_nl_family);
 }
index 5d4637e586e8e7b523778d9d3509be77d8676509..220e9dc8ccf8a19c49df744813414637a47eec59 100644 (file)
@@ -3228,7 +3228,7 @@ static const struct genl_ops hwsim_ops[] = {
        },
 };
 
-static struct genl_family hwsim_genl_family = {
+static struct genl_family hwsim_genl_family __ro_after_init = {
        .name = "MAC80211_HWSIM",
        .version = 1,
        .maxattr = HWSIM_ATTR_MAX,
@@ -3287,7 +3287,7 @@ static struct notifier_block hwsim_netlink_notifier = {
        .notifier_call = mac80211_hwsim_netlink_notify,
 };
 
-static int hwsim_init_netlink(void)
+static int __init hwsim_init_netlink(void)
 {
        int rc;
 
index c0ab7bb8c3ce094fbc93c754335d7192695b8dad..845affa112f711d8df861d3dd36299377a6ff34a 100644 (file)
@@ -1368,7 +1368,7 @@ static struct genl_multicast_group pmcraid_mcgrps[] = {
        { .name = "events", /* not really used - see ID discussion below */ },
 };
 
-static struct genl_family pmcraid_event_family = {
+static struct genl_family pmcraid_event_family __ro_after_init = {
        .module = THIS_MODULE,
        .name = "pmcraid",
        .version = 1,
@@ -1384,7 +1384,7 @@ static struct genl_family pmcraid_event_family = {
  *     0 if the pmcraid_event_family is successfully registered
  *     with netlink generic, non-zero otherwise
  */
-static int pmcraid_netlink_init(void)
+static int __init pmcraid_netlink_init(void)
 {
        int result;
 
index 3483372f556298a7c19265e61eb65ebb9bd08c17..0f173bf7dbac7a1236ee96d26c599718d1e1ec42 100644 (file)
@@ -147,7 +147,7 @@ static const struct genl_multicast_group tcmu_mcgrps[] = {
 };
 
 /* Our generic netlink family */
-static struct genl_family tcmu_genl_family = {
+static struct genl_family tcmu_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .hdrsize = 0,
        .name = "TCM-USER",
index 93b6caab2d9f04a3066337ded20bb4545c0bcee0..911fd964c742485847fde04b83254135abcead53 100644 (file)
@@ -2163,7 +2163,7 @@ static const struct genl_multicast_group thermal_event_mcgrps[] = {
        { .name = THERMAL_GENL_MCAST_GROUP_NAME, },
 };
 
-static struct genl_family thermal_event_genl_family = {
+static struct genl_family thermal_event_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .name = THERMAL_GENL_FAMILY_NAME,
        .version = THERMAL_GENL_VERSION,
@@ -2235,7 +2235,7 @@ int thermal_generate_netlink_event(struct thermal_zone_device *tz,
 }
 EXPORT_SYMBOL_GPL(thermal_generate_netlink_event);
 
-static int genetlink_init(void)
+static int __init genetlink_init(void)
 {
        return genl_register_family(&thermal_event_genl_family);
 }
index 04042d69573c05033ecc4a728f6bdd2591382382..0643ae44f3427ddc1088cccb6a0a710039cdc6e1 100644 (file)
@@ -72,7 +72,7 @@ static struct genl_ops dlm_nl_ops[] = {
        },
 };
 
-static struct genl_family family = {
+static struct genl_family family __ro_after_init = {
        .name           = DLM_GENL_NAME,
        .version        = DLM_GENL_VERSION,
        .ops            = dlm_nl_ops,
index 9457c7b0dfa20254395ffd938d62f0f2da1c9950..e99b1a72d9a7348abd9d59a37d661ec335bfe73b 100644 (file)
@@ -12,7 +12,7 @@ static const struct genl_multicast_group quota_mcgrps[] = {
 };
 
 /* Netlink family structure for quota */
-static struct genl_family quota_genl_family = {
+static struct genl_family quota_genl_family __ro_after_init = {
        .module = THIS_MODULE,
        .hdrsize = 0,
        .name = "VFS_DQUOT",
index 40c2e39362c86a60f423a1622be398bd4dbe34bd..377257d8f7e3557fe1f98eae3a5f906eb68bac44 100644 (file)
@@ -293,7 +293,7 @@ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)(   \
 #undef GENL_mc_group
 #define GENL_mc_group(group)
 
-static struct genl_family ZZZ_genl_family __read_mostly = {
+static struct genl_family ZZZ_genl_family __ro_after_init = {
        .name = __stringify(GENL_MAGIC_FAMILY),
        .version = GENL_MAGIC_VERSION,
 #ifdef GENL_MAGIC_FAMILY_HDRSZ
index 4075ece592f2b8ddf7347987aea402e30c47f589..9b7f838511cea8ea32f71adf3850e4517cddc8d4 100644 (file)
@@ -646,7 +646,7 @@ static const struct genl_ops taskstats_ops[] = {
        },
 };
 
-static struct genl_family family = {
+static struct genl_family family __ro_after_init = {
        .name           = TASKSTATS_GENL_NAME,
        .version        = TASKSTATS_GENL_VERSION,
        .maxattr        = TASKSTATS_CMD_ATTR_MAX,
index e28cec34a016499642b7ebb1fc3abad898dba921..005012ba9b48279040fe30e40f99892474601bc0 100644 (file)
@@ -603,7 +603,7 @@ static struct genl_ops batadv_netlink_ops[] = {
 
 };
 
-struct genl_family batadv_netlink_family = {
+struct genl_family batadv_netlink_family __ro_after_init = {
        .hdrsize = 0,
        .name = BATADV_NL_NAME,
        .version = 1,
index 063da8091aefa65dda5bf48fb800066defb819a3..c14f8b661db99f1bb2b0d6a475dbddca18703b85 100644 (file)
@@ -1612,7 +1612,7 @@ static const struct genl_ops devlink_nl_ops[] = {
        },
 };
 
-static struct genl_family devlink_nl_family = {
+static struct genl_family devlink_nl_family __ro_after_init = {
        .name           = DEVLINK_GENL_NAME,
        .version        = DEVLINK_GENL_VERSION,
        .maxattr        = DEVLINK_ATTR_MAX,
index 80c002794ff668d952a81980bfd45d82ebc2a213..8e0c0635ee975e1c71a126677f63ff220f7f0c44 100644 (file)
@@ -346,7 +346,7 @@ static const struct genl_ops dropmon_ops[] = {
        },
 };
 
-static struct genl_family net_drop_monitor_family = {
+static struct genl_family net_drop_monitor_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = "NET_DM",
        .version        = 2,
index aab34c7f6f89795496ccb174ca52a389a81f08a0..1ab30e7d3f99e19c5e54fd9747cfce7a5c1f559b 100644 (file)
@@ -461,7 +461,7 @@ static const struct genl_ops hsr_ops[] = {
        },
 };
 
-static struct genl_family hsr_genl_family = {
+static struct genl_family hsr_genl_family __ro_after_init = {
        .hdrsize = 0,
        .name = "HSR",
        .version = 1,
index 08e62470bac2fd18a807906182807c5579890c07..6bde9e5a55031c9a184c418588a78790405b1b83 100644 (file)
@@ -131,7 +131,7 @@ static const struct genl_multicast_group ieee802154_mcgrps[] = {
        [IEEE802154_BEACON_MCGRP] = { .name = IEEE802154_MCAST_BEACON_NAME, },
 };
 
-struct genl_family nl802154_family = {
+struct genl_family nl802154_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = IEEE802154_NL_NAME,
        .version        = 1,
index f7e75578aeddf12fbf643c2b45fdd2d84467eaac..fc60cd061f3966a2381803a8e4d85206770253dc 100644 (file)
@@ -2462,7 +2462,7 @@ static const struct genl_ops nl802154_ops[] = {
 #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
 };
 
-static struct genl_family nl802154_fam = {
+static struct genl_family nl802154_fam __ro_after_init = {
        .name = NL802154_GENL_NAME,     /* have users key off the name instead */
        .hdrsize = 0,                   /* no private header */
        .version = 1,                   /* no particular meaning now */
@@ -2478,7 +2478,7 @@ static struct genl_family nl802154_fam = {
 };
 
 /* initialisation/exit functions */
-int nl802154_init(void)
+int __init nl802154_init(void)
 {
        return genl_register_family(&nl802154_fam);
 }
index 5b5226a2434f8d4c052d12f8212b44a1133a1a22..6cb57bb8692d8f9dd1f122a3ab1c7f13bf97bf02 100644 (file)
@@ -824,7 +824,7 @@ static const struct genl_ops fou_nl_ops[] = {
        },
 };
 
-static struct genl_family fou_nl_family = {
+static struct genl_family fou_nl_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = FOU_GENL_NAME,
        .version        = FOU_GENL_VERSION,
index bba3c72c4a3909a3e68dce1685df088a83b8ad6f..d46f4d5b1c62edf95791e9d47d966c3bc61e1888 100644 (file)
@@ -1109,7 +1109,7 @@ static const struct genl_ops tcp_metrics_nl_ops[] = {
        },
 };
 
-static struct genl_family tcp_metrics_nl_family = {
+static struct genl_family tcp_metrics_nl_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = TCP_METRICS_GENL_NAME,
        .version        = TCP_METRICS_GENL_VERSION,
index 97f7b0cc46750d273a4385ec5261cd97a72c7d41..628ae6d85b59a2bb731df8a8fb888d97546a53c0 100644 (file)
@@ -553,7 +553,7 @@ static const struct genl_ops ila_nl_ops[] = {
        },
 };
 
-static struct genl_family ila_nl_family = {
+static struct genl_family ila_nl_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = ILA_GENL_NAME,
        .version        = ILA_GENL_VERSION,
@@ -627,7 +627,7 @@ static int ila_xlat_addr(struct sk_buff *skb, bool set_csum_neutral)
        return 0;
 }
 
-int ila_xlat_init(void)
+int __init ila_xlat_init(void)
 {
        int ret;
 
index 07877347c2f77f13af40178cc0709f0d7f06e23c..7fc340e574cf3b1e5484cbcbabe3a1e33be582b4 100644 (file)
@@ -141,7 +141,7 @@ static const struct genl_ops irda_nl_ops[] = {
 
 };
 
-static struct genl_family irda_nl_family = {
+static struct genl_family irda_nl_family __ro_after_init = {
        .name = IRDA_NL_NAME,
        .hdrsize = 0,
        .version = IRDA_NL_VERSION,
@@ -151,7 +151,7 @@ static struct genl_family irda_nl_family = {
        .n_ops = ARRAY_SIZE(irda_nl_ops),
 };
 
-int irda_nl_register(void)
+int __init irda_nl_register(void)
 {
        return genl_register_family(&irda_nl_family);
 }
index e4e8c0769a6be69a8f5fd09ae937fe3fbb8062da..59aa2d204e4aa0ceda4d10068e73cb1ef1498af0 100644 (file)
@@ -970,7 +970,7 @@ static const struct genl_ops l2tp_nl_ops[] = {
        },
 };
 
-static struct genl_family l2tp_nl_family = {
+static struct genl_family l2tp_nl_family __ro_after_init = {
        .name           = L2TP_GENL_NAME,
        .version        = L2TP_GENL_VERSION,
        .hdrsize        = 0,
@@ -1016,7 +1016,7 @@ void l2tp_nl_unregister_ops(enum l2tp_pwtype pw_type)
 }
 EXPORT_SYMBOL_GPL(l2tp_nl_unregister_ops);
 
-static int l2tp_nl_init(void)
+static int __init l2tp_nl_init(void)
 {
        pr_info("L2TP netlink interface\n");
        return genl_register_family(&l2tp_nl_family);
index ea3e8aed063ff3eb89c9116697066ea4e657ef4c..6b85ded4f91d44abf0917cb74f259015fd8394c1 100644 (file)
@@ -3865,7 +3865,7 @@ static const struct genl_ops ip_vs_genl_ops[] = {
        },
 };
 
-static struct genl_family ip_vs_genl_family = {
+static struct genl_family ip_vs_genl_family __ro_after_init = {
        .hdrsize        = 0,
        .name           = IPVS_GENL_NAME,
        .version        = IPVS_GENL_VERSION,
index ca7c9c411a5c9824d4c56914914774e1e4be5ed0..d177dd0665043652c199605479959ea408145a4b 100644 (file)
@@ -349,7 +349,7 @@ static const struct genl_ops netlbl_calipso_ops[] = {
        },
 };
 
-static struct genl_family netlbl_calipso_gnl_family = {
+static struct genl_family netlbl_calipso_gnl_family __ro_after_init = {
        .hdrsize = 0,
        .name = NETLBL_NLTYPE_CALIPSO_NAME,
        .version = NETLBL_PROTO_VERSION,
index a665eae91245114270bfec2b640c1b766dd11dbe..4149d3e6358976f093dbcb25dee79d10f6275231 100644 (file)
@@ -760,7 +760,7 @@ static const struct genl_ops netlbl_cipsov4_ops[] = {
        },
 };
 
-static struct genl_family netlbl_cipsov4_gnl_family = {
+static struct genl_family netlbl_cipsov4_gnl_family __ro_after_init = {
        .hdrsize = 0,
        .name = NETLBL_NLTYPE_CIPSOV4_NAME,
        .version = NETLBL_PROTO_VERSION,
index ecfe8eb149db5def8a0e506cd647959d32ce1d41..21e0095b1d1422aff42e068490819fd3ac540c58 100644 (file)
@@ -828,7 +828,7 @@ static const struct genl_ops netlbl_mgmt_genl_ops[] = {
        },
 };
 
-static struct genl_family netlbl_mgmt_gnl_family = {
+static struct genl_family netlbl_mgmt_gnl_family __ro_after_init = {
        .hdrsize = 0,
        .name = NETLBL_NLTYPE_MGMT_NAME,
        .version = NETLBL_PROTO_VERSION,
index 5dbbad41114f8fd51a7ac69786da13f27b4ec1c3..22dc1b9d63625e76c72bdb80b97b1d07540fac32 100644 (file)
@@ -1372,7 +1372,7 @@ static const struct genl_ops netlbl_unlabel_genl_ops[] = {
        },
 };
 
-static struct genl_family netlbl_unlabel_gnl_family = {
+static struct genl_family netlbl_unlabel_gnl_family __ro_after_init = {
        .hdrsize = 0,
        .name = NETLBL_NLTYPE_UNLABELED_NAME,
        .version = NETLBL_PROTO_VERSION,
index 85659921e7b2317c846b4e148abba66219708c04..df0cbcddda2c5db66152c5ceecbdf876e3a48fe9 100644 (file)
@@ -936,7 +936,7 @@ static const struct genl_multicast_group genl_ctrl_groups[] = {
        { .name = "notify", },
 };
 
-static struct genl_family genl_ctrl = {
+static struct genl_family genl_ctrl __ro_after_init = {
        .module = THIS_MODULE,
        .ops = genl_ctrl_ops,
        .n_ops = ARRAY_SIZE(genl_ctrl_ops),
index 450b1e5144cc71cb89ee7dd9048ec164211e12b7..03f3d5c7beb8d173fae25456b278ee9cf3e04c5e 100644 (file)
@@ -1746,7 +1746,7 @@ static const struct genl_ops nfc_genl_ops[] = {
        },
 };
 
-static struct genl_family nfc_genl_family = {
+static struct genl_family nfc_genl_family __ro_after_init = {
        .hdrsize = 0,
        .name = NFC_GENL_NAME,
        .version = NFC_GENL_VERSION,
index ad6a111a001437208459ca14666eb4a8d91a5343..fa8760176b7d59106ef699c397e1eae432cfc1c0 100644 (file)
@@ -670,7 +670,7 @@ static const struct genl_ops dp_packet_genl_ops[] = {
        }
 };
 
-static struct genl_family dp_packet_genl_family = {
+static struct genl_family dp_packet_genl_family __ro_after_init = {
        .hdrsize = sizeof(struct ovs_header),
        .name = OVS_PACKET_FAMILY,
        .version = OVS_PACKET_VERSION,
@@ -1435,7 +1435,7 @@ static const struct genl_ops dp_flow_genl_ops[] = {
        },
 };
 
-static struct genl_family dp_flow_genl_family = {
+static struct genl_family dp_flow_genl_family __ro_after_init = {
        .hdrsize = sizeof(struct ovs_header),
        .name = OVS_FLOW_FAMILY,
        .version = OVS_FLOW_VERSION,
@@ -1821,7 +1821,7 @@ static const struct genl_ops dp_datapath_genl_ops[] = {
        },
 };
 
-static struct genl_family dp_datapath_genl_family = {
+static struct genl_family dp_datapath_genl_family __ro_after_init = {
        .hdrsize = sizeof(struct ovs_header),
        .name = OVS_DATAPATH_FAMILY,
        .version = OVS_DATAPATH_VERSION,
@@ -2243,7 +2243,7 @@ static const struct genl_ops dp_vport_genl_ops[] = {
        },
 };
 
-struct genl_family dp_vport_genl_family = {
+struct genl_family dp_vport_genl_family __ro_after_init = {
        .hdrsize = sizeof(struct ovs_header),
        .name = OVS_VPORT_FAMILY,
        .version = OVS_VPORT_VERSION,
@@ -2272,7 +2272,7 @@ static void dp_unregister_genl(int n_families)
                genl_unregister_family(dp_genl_families[i]);
 }
 
-static int dp_register_genl(void)
+static int __init dp_register_genl(void)
 {
        int err;
        int i;
index 74a405bf107bd57d51b3ffee1594d72321e84dfd..26ca8dd64ded64407db8ef885f8dbb6edd30e4b8 100644 (file)
@@ -249,7 +249,7 @@ static const struct genl_ops tipc_genl_v2_ops[] = {
 #endif
 };
 
-struct genl_family tipc_genl_family = {
+struct genl_family tipc_genl_family __ro_after_init = {
        .name           = TIPC_GENL_V2_NAME,
        .version        = TIPC_GENL_V2_VERSION,
        .hdrsize        = 0,
@@ -271,7 +271,7 @@ int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr)
        return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy);
 }
 
-int tipc_netlink_start(void)
+int __init tipc_netlink_start(void)
 {
        int res;
 
index 07b19931e458461b5e93fce137dd855cf17c43c8..e1ae8a8a2b8eacf93224cc332fff4a537d8d1ab0 100644 (file)
@@ -1222,7 +1222,7 @@ static struct genl_ops tipc_genl_compat_ops[] = {
        },
 };
 
-static struct genl_family tipc_genl_compat_family = {
+static struct genl_family tipc_genl_compat_family __ro_after_init = {
        .name           = TIPC_GENL_NAME,
        .version        = TIPC_GENL_VERSION,
        .hdrsize        = TIPC_GENL_HDRLEN,
@@ -1233,7 +1233,7 @@ static struct genl_family tipc_genl_compat_family = {
        .n_ops          = ARRAY_SIZE(tipc_genl_compat_ops),
 };
 
-int tipc_netlink_compat_start(void)
+int __init tipc_netlink_compat_start(void)
 {
        int res;
 
index 587e1627681f079c317cb63fdc4df96646fba7ac..5db731512014b3bddaf6f6553a646b7f8204a562 100644 (file)
@@ -576,7 +576,7 @@ static const struct genl_multicast_group wimax_gnl_mcgrps[] = {
        { .name = "msg", },
 };
 
-struct genl_family wimax_gnl_family = {
+struct genl_family wimax_gnl_family __ro_after_init = {
        .name = "WiMAX",
        .version = WIMAX_GNL_VERSION,
        .hdrsize = 0,
index 8e5ca3c475933fad902219453ab55a3caefa4bb5..271707dacfea4ddedb85224ac5773fa909ce256f 100644 (file)
@@ -12586,7 +12586,7 @@ static const struct genl_ops nl80211_ops[] = {
        },
 };
 
-static struct genl_family nl80211_fam = {
+static struct genl_family nl80211_fam __ro_after_init = {
        .name = NL80211_GENL_NAME,      /* have users key off the name instead */
        .hdrsize = 0,                   /* no private header */
        .version = 1,                   /* no particular meaning now */
@@ -14563,7 +14563,7 @@ void nl80211_send_ap_stopped(struct wireless_dev *wdev)
 
 /* initialisation/exit functions */
 
-int nl80211_init(void)
+int __init nl80211_init(void)
 {
        int err;