Backports Archive on lore.kernel.org
 help / color / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: johannes@sipsolutions.net
Cc: backports@vger.kernel.org, john@phrozen.org,
	Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 09/10] backports: Make netdev destructor spatch apply correctly again
Date: Sun, 23 Sep 2018 19:45:34 +0200
Message-ID: <20180923174535.16198-10-hauke@hauke-m.de> (raw)
In-Reply-To: <20180923174535.16198-1-hauke@hauke-m.de>

The netdev destructor spatch did not apply to the wil6210 driver any
more, because there the calls were done in a different order compared to
the spatch. Add an additional rule which applies when the order is
changed.

Fixes: 30a378636e47 ("backports: speed up netdev destructor spatch by two orders of magnitude")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0079-netdev-destructor.cocci | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/patches/0079-netdev-destructor.cocci b/patches/0079-netdev-destructor.cocci
index f2bea35b..8d7228ec 100644
--- a/patches/0079-netdev-destructor.cocci
+++ b/patches/0079-netdev-destructor.cocci
@@ -67,6 +67,38 @@ if (<+... RET ...+>) {
 	...>
 }
 
+@r11@
+struct net_device *NDEV;
+identifier D, C;
+identifier TRUE =~ "true";
+@@
+C(...)
+{
+	<+...
+-	NDEV->priv_destructor = D;
+-	NDEV->needs_free_netdev = TRUE;
++	netdev_set_priv_destructor(NDEV, D);
+	...+>
+}
+
+@r12 depends on r11@
+identifier r11.D, r11.C;
+fresh identifier E = "__" ## D;
+@@
+
++#if LINUX_VERSION_IS_LESS(4,12,0)
++static void E(struct net_device *ndev)
++{
++	D(ndev);
++	free_netdev(ndev);
++}
++#endif
++
+C(...)
+{
+	...
+}
+
 @r5@
 struct net_device *NDEV;
 identifier TRUE =~ "true";
-- 
2.11.0

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

  parent reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-23 17:45 [PATCH 00/10] backports: misc fixes to improve support of 4.19 Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 01/10] backports: Remove ssb and bcma Hauke Mehrtens
2018-09-23 20:10   ` Johannes Berg
2018-09-23 20:18     ` Hauke Mehrtens
2018-09-24 10:48   ` Johannes Berg
2018-09-24 20:17     ` Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 02/10] backports: Remove NFC support Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 03/10] copy: Add crc32poly.h Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 04/10] dependencies: Make RSI_COEX coexistence depend on kernel >= 4.17 Hauke Mehrtens
2018-09-23 20:20   ` Johannes Berg
2018-09-23 17:45 ` [PATCH 05/10] dependencies: Make WIL6210 depend on kernel >= 4.8 Hauke Mehrtens
2018-09-23 20:12   ` Johannes Berg
2018-09-23 20:36     ` Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 06/10] dependencies: make hostap and atmel depend on kernel >= 4.18 Hauke Mehrtens
2018-09-23 20:17   ` Johannes Berg
2018-09-23 20:23     ` Hauke Mehrtens
2018-09-23 20:33       ` Johannes Berg
2018-09-23 17:45 ` [PATCH 07/10] patches: make mt76 use skb_pad() instead of __skb_pad() Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 08/10] patches: remove .coredump from struct driver for kernel < 4.16 Hauke Mehrtens
2018-09-24  8:36   ` Johannes Berg
2018-09-24 20:20     ` Hauke Mehrtens
2018-09-23 17:45 ` Hauke Mehrtens [this message]
2018-09-23 20:17   ` [PATCH 09/10] backports: Make netdev destructor spatch apply correctly again Johannes Berg
2018-09-23 17:45 ` [PATCH 10/10] patches: Do not remove linux/kmemleak.h include Hauke Mehrtens
2018-09-23 20:18   ` Johannes Berg
2018-09-24  8:12 ` [PATCH 00/10] backports: misc fixes to improve support of 4.19 Johannes Berg
2018-09-24 20:27   ` Hauke Mehrtens
2018-09-24 20:28     ` Johannes Berg

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=20180923174535.16198-10-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=john@phrozen.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

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git