Re: [PATCH V2] backport: handle change in netdevice destructor usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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:

+#define netdev_set_priv_destructor(_dev, _destructor) \
+	(_dev)->destructor = __ ## _destructor
+	(_dev)->needs_free_netdev = true;
+	if (_destructor != free_netdev)
+		(_dev)->priv_destructor = _destructor;

So I will fix that, but I do not quite understand your comment.
Expanding the macro in spatch output for net/mac80211/iface.c:

+static void __ieee80211_if_free(struct net_device *ndev)
+	ieee80211_if_free(ndev);
+	free_netdev(ndev);
 static void ieee80211_if_setup(struct net_device *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;
+       dev->destructor = __ieee80211_if_free
+       dev->needs_free_netdev = true;
+       if (ieee80211_if_free != free_netdev)
+               dev->priv_destructor = ieee80211_if_free;

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.

To unsubscribe from this list: send the line "unsubscribe backports" in

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux