diff mbox

backports: provide backport of devcoredump when disabled in kernels >= 3.18

Message ID 20170530080934.7214-1-luca@coelho.fi (mailing list archive)
State Accepted
Headers show

Commit Message

Luca Coelho May 30, 2017, 8:09 a.m. UTC
From: Luca Coelho <luciano.coelho@intel.com>

When devcoredump is not enabled in a kernel that supports it, we would
only use stubs for the devcoredump in the backports.  Allow the
backport to compile when that's the case.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/compat/Kconfig        | 1 -
 backport/compat/backport-4.7.c | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 335d9058072e..f66d5f74ba18 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -128,7 +128,6 @@  config BPAUTO_WANT_DEV_COREDUMP
 
 config BPAUTO_BUILD_WANT_DEV_COREDUMP
 	bool
-	depends on KERNEL_3_18
 	default n if DEV_COREDUMP
 	default n if DISABLE_DEV_COREDUMP
 	default y if BPAUTO_WANT_DEV_COREDUMP
diff --git a/backport/compat/backport-4.7.c b/backport/compat/backport-4.7.c
index 25a00235bce4..b064707767c6 100644
--- a/backport/compat/backport-4.7.c
+++ b/backport/compat/backport-4.7.c
@@ -116,8 +116,12 @@  int nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen,
 }
 EXPORT_SYMBOL_GPL(nla_put_64bit);
 
-/* below 3.18 we copied the entire devcoredump */
-#if LINUX_VERSION_IS_GEQ(3,18,0)
+/*
+ * Below 3.18 or if the kernel has devcoredump disabled, we copied the
+ * entire devcoredump, so no need to define these functions.
+ */
+#if LINUX_VERSION_IS_GEQ(3,18,0) && \
+	!defined(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP)
 #include <linux/devcoredump.h>
 #include <linux/scatterlist.h>