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