From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: backports@vger.kernel.org
Subject: Re: [PATCH V2] backport: handle change in netdevice destructor usage
Date: Wed, 21 Jun 2017 23:50:22 +0200 [thread overview]
Message-ID: <2ed2b0d7-7e5a-48b3-e8b1-d52ac644293d@broadcom.com> (raw)
In-Reply-To: <1498079928.9688.2.camel@sipsolutions.net>
On 21-06-17 23:18, Johannes Berg wrote:
> Perhaps that can be fixed as such:
>
>> +@r2 depends on r1@
>> +identifier r1.D, r1.C;
>> +fresh identifier E = "__" ## D;
>
> attribute __maybe_unused;
>
>> +@@
>> +
>> ++#if LINUX_VERSION_IS_LESS(4,13,0)
>> ++static void E(struct net_device *ndev)
>
> __maybe_unused
Ok. I clearly made a mistake in #else of the macro:
+#if LINUX_VERSION_IS_LESS(4,13,0)
+#define netdev_set_priv_destructor(_dev, _destructor) \
+ (_dev)->destructor = __ ## _destructor
+#else
+ (_dev)->needs_free_netdev = true;
+ if (_destructor != free_netdev)
+ (_dev)->priv_destructor = _destructor;
+#endif
So I will fix that, but I do not quite understand your comment.
Expanding the macro in spatch output for net/mac80211/iface.c:
+#if LINUX_VERSION_IS_LESS(4,13,0)
+static void __ieee80211_if_free(struct net_device *ndev)
+{
+ ieee80211_if_free(ndev);
+ free_netdev(ndev);
+}
+#endif
+
static void ieee80211_if_setup(struct net_device *dev)
{
ether_setup(dev);
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->netdev_ops = &ieee80211_dataif_ops;
- dev->needs_free_netdev = true;
- dev->priv_destructor = ieee80211_if_free;
+#if LINUX_VERSION_IS_LESS(4,13,0)
+ dev->destructor = __ieee80211_if_free
+#else
+ dev->needs_free_netdev = true;
+ if (ieee80211_if_free != free_netdev)
+ dev->priv_destructor = ieee80211_if_free;
+#endif
}
So __ieee80211_if_free is only defined for lower kernels and it is only
used for lower kernels. Adding the __ieee80211_if_free depends on r1 in
the semantic patch.
So I will send a V3 fixing the macro in netdevice.h, but I don't think
we need the maybe_unused attribute.
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next prev parent reply other threads:[~2017-06-21 21:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 20:58 [PATCH V2] backport: handle change in netdevice destructor usage Arend van Spriel
2017-06-21 21:17 ` Johannes Berg
2017-06-21 21:18 ` Johannes Berg
2017-06-21 21:50 ` Arend van Spriel [this message]
2017-06-21 21:52 ` Johannes Berg
2017-06-21 21:53 ` Arend van Spriel
-- strict thread matches above, loose matches on Subject: below --
2017-06-21 9:40 Arend van Spriel
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=2ed2b0d7-7e5a-48b3-e8b1-d52ac644293d@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=backports@vger.kernel.org \
--cc=johannes@sipsolutions.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox