From 26c7795a6feddcadbfdc9debab2db1015ba4c732 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 23 Sep 2018 19:45:33 +0200 Subject: patches: remove .coredump from struct driver for kernel < 4.16 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 Signed-off-by: Johannes Berg --- patches/0088-coredump.cocci | 93 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 patches/0088-coredump.cocci (limited to 'patches') 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 -- cgit v1.2.3