[PATCH 08/10] patches: remove .coredump from struct driver for kernel < 4.16

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

 



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@xxxxxxxxxx>
---
 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



[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