diff mbox series

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

Message ID 20180923174535.16198-9-hauke@hauke-m.de (mailing list archive)
State Accepted
Headers show
Series backports: misc fixes to improve support of 4.19 | expand

Commit Message

Hauke Mehrtens Sept. 23, 2018, 5:45 p.m. UTC
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

Comments

Johannes Berg Sept. 24, 2018, 8:36 a.m. UTC | #1
On Sun, 2018-09-23 at 19:45 +0200, Hauke Mehrtens wrote:
> 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.

Note that this isn't sufficient.

On 4.16, the return value was int, now it's void. I'll change this patch
to be for < 4.17, but if somebody wants to submit an spatch to fix up
the difference that would work too.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in
Hauke Mehrtens Sept. 24, 2018, 8:20 p.m. UTC | #2
On 09/24/2018 10:36 AM, Johannes Berg wrote:
> On Sun, 2018-09-23 at 19:45 +0200, Hauke Mehrtens wrote:
>> 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.
> 
> Note that this isn't sufficient.
> 
> On 4.16, the return value was int, now it's void. I'll change this patch
> to be for < 4.17, but if somebody wants to submit an spatch to fix up
> the difference that would work too.
> 
> johannes
> 
Thanks for fixing this, I didn't noticed that this changed between 4.16
and 4.17. I think it is ok to only provide this on kernel >= 4.17, this
is an not essential feature and 4.16 is not a long term kernel.

Hauke
diff mbox series

Patch

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