Skip to contentSkip to conversation

backport: backport debugfs_create_bool()

PATCH In review Johannes Berg 2 participants 2 messages Nov 6, 2015 – Nov 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 backport: backport debugfs_create_bool()

From: Johannes Berg <[email protected]>

The prototype for this function is changing upstream, so backport a copy of the new one that has a bool * argument instead of u32 *.

---
 backport/backport-include/linux/debugfs.h | 15 ++++++++
 backport/compat/Makefile                  |  1 +
 backport/compat/backport-4.4.c            | 64 +++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 backport/compat/backport-4.4.c
backport/backport-include/linux/debugfs.h +15 -0
index a68435322b4b..5ea4bfbe928e 100644
@@ -24,4 +24,19 @@ static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
 #endif /* CONFIG_DEBUG_FS */
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
+#define debugfs_create_bool LINUX_BACKPORT(debugfs_create_bool)
+#ifdef CONFIG_DEBUG_FS
+struct dentry *debugfs_create_bool(const char *name, umode_t mode,
+				   struct dentry *parent, bool *value);
+#else
+static inline struct dentry *
+debugfs_create_bool(const char *name, umode_t mode,
+		    struct dentry *parent, bool *value)
+{
+	return ERR_PTR(-ENODEV);
+}
+#endif
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) */
+
 #endif /* __BACKPORT_DEBUGFS_H_ */
backport/compat/Makefile +1 -0
index 666ef9111ace..fa992e780ec1 100644
@@ -29,6 +29,7 @@ compat-$(CPTCFG_KERNEL_4_0) += backport-4.0.o
 compat-$(CPTCFG_KERNEL_4_1) += backport-4.1.o
 compat-$(CPTCFG_KERNEL_4_2) += backport-4.2.o
 compat-$(CPTCFG_KERNEL_4_3) += backport-4.3.o
+compat-$(CPTCFG_KERNEL_4_4) += backport-4.4.o
 
 compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o
 compat-$(CPTCFG_BPAUTO_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
backport/compat/backport-4.4.c new file +64 -0

64 lines not on this page · raw message

Signature · 4 lines
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#1 lore raw
Quoted 5 lines · Johannes Berg

From: Johannes Berg <[email protected]>

The prototype for this function is changing upstream, so backport a copy of the new one that has a bool * argument instead of u32 *.

Quoted 8 lines
---
 backport/backport-include/linux/debugfs.h | 15 ++++++++
 backport/compat/Makefile                  |  1 +
 backport/compat/backport-4.4.c            | 64 +++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 backport/compat/backport-4.4.c

Thank you for the patch, it was applied.

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in