All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH next v2 3/3] batman-adv: make netlink attributes const
Date: Sun, 9 Oct 2016 04:07:10 +0200	[thread overview]
Message-ID: <20161009020710.GC5216@otheros> (raw)
In-Reply-To: <20160915135249.1925-3-sven@narfation.org>

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?

  reply	other threads:[~2016-10-09  2:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 13:52 [B.A.T.M.A.N.] [PATCH next v2 1/3] batman-adv: Introduce compat-patches support Sven Eckelmann
2016-09-15 13:52 ` [B.A.T.M.A.N.] [PATCH next v2 2/3] batman-adv: Use simple script to patch minor compat problems Sven Eckelmann
2016-09-16 15:34   ` Sven Eckelmann
2016-09-15 13:52 ` [B.A.T.M.A.N.] [PATCH next v2 3/3] batman-adv: make netlink attributes const Sven Eckelmann
2016-10-09  2:07   ` Linus Lüssing [this message]
2016-10-09  6:25     ` Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161009020710.GC5216@otheros \
    --to=linus.luessing@c0d3.blue \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.