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 08/10] patches: remove .coredump from struct driver for kernel < 4.16
Date: Sun, 23 Sep 2018 19:45:33 +0200
Message-ID: <20180923174535.16198-9-hauke@hauke-m.de> (raw)
In-Reply-To: <20180923174535.16198-1-hauke@hauke-m.de>

Kernel 4.16 added a new .coredump member to the driver structure which
can be implemented by drivers. Remove this member on older kernel
versions as they do not support this feature.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0088-coredump.cocci | 93 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 patches/0088-coredump.cocci

diff --git a/patches/0088-coredump.cocci b/patches/0088-coredump.cocci
new file mode 100644
index 00000000..329e0315
--- /dev/null
+++ b/patches/0088-coredump.cocci
@@ -0,0 +1,93 @@
+@r1@
+identifier drv, fn;
+@@
+static struct pci_driver drv = {
+	.driver = {
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+		.coredump = fn,
++#endif
+		...
+	},
+	...
+};
+
+@r11 depends on r1@
+identifier r1.fn;
+@@
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+fn(...)
+{
+	...
+}
++#endif
+
+
+@r2@
+identifier drv, fn;
+@@
+ static struct pci_driver drv = {
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+	.driver.coredump = fn,
++#endif
+	...
+ };
+
+@r21 depends on r2@
+identifier r2.fn;
+@@
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+fn(...)
+{
+	...
+}
++#endif
+
+
+@r3@
+identifier drv, fn;
+@@
+static struct usb_driver drv = {
+	.drvwrap.driver = {
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+		.coredump = fn,
++#endif
+		...
+	},
+	...
+};
+
+
+@r31 depends on r3@
+identifier r3.fn;
+@@
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+fn(...)
+{
+	...
+}
++#endif
+
+
+@r4@
+identifier driver, fn;
+@@
+ static struct sdio_driver driver = {
+	.drv = {
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+		.coredump = fn,
++#endif
+		...
+	},
+	...
+};
+
+
+@r41 depends on r4@
+identifier r4.fn;
+@@
++#if LINUX_VERSION_IS_GEQ(4,16,0)
+fn(...)
+{
+	...
+}
++#endif
-- 
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 ` Hauke Mehrtens [this message]
2018-09-24  8:36   ` [PATCH 08/10] patches: remove .coredump from struct driver for kernel < 4.16 Johannes Berg
2018-09-24 20:20     ` Hauke Mehrtens
2018-09-23 17:45 ` [PATCH 09/10] backports: Make netdev destructor spatch apply correctly again Hauke Mehrtens
2018-09-23 20:17   ` 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-9-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