On Thu, Sep 15, 2016 at 03:52:49PM +0200, Sven Eckelmann wrote:
+sed -i \
- -e 's/^static const struct genl_multicast_group batadv_netlink_mcgrps/static struct genl_multicast_group batadv_netlink_mcgrps/' \
- -e 's/^static const struct nla_policy batadv_netlink_policy/static const struct nla_policy batadv_netlink_policy/' \
For the second thing: Replacing the string with itself?
Just wondering... I simply tried casting the const away and that seems to compile without a warning:
----- static inline int batadv_genl_register_family_with_ops_grps(struct genl_family *family, struct genl_ops *ops, size_t n_ops, - struct genl_multicast_group *mcgrps, + const struct genl_multicast_group *mcgrps, size_t n_mcgrps) { family->ops = ops; family->n_ops = n_ops; - family->mcgrps = mcgrps; + family->mcgrps = (struct genl_multicast_group *)mcgrps; family->n_mcgrps = n_mcgrps; family->module = THIS_MODULE; -----
Or does this lead to some dangerous behaviour on the compiler side?