summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723bs/include
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-04-21 22:59:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 12:10:51 +0200
commitf55a6d457b215e5a382d6001a166ae2089fc81b6 (patch)
treef0f11c5f379ecc92ac54d5d518b6e4477bfadd58 /drivers/staging/rtl8723bs/include
parentc45112e467ab0a5dbc13f36b0420518e1ee9c072 (diff)
staging: rtl8723bs: rework debug configuration handling
I ran into this warning during randconfig testing: drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable] drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable] The problem is that the code procfs code gets built even when CONFIG_PROC_FS is disabled, but some functions are turned into empty stubs then. This is easily addressed by adding an #ifdef around the definition of the CONFIG_PROC_DEBUG macro. However, I could not bear looking at the macro name that clashes with the Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same way. This is consistent with how we handle the same checks in the non-staging rtlwifi driver. As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it turned out to be incorrect and requires adding 'static inline' annotations for the stub handlers, and moving some variables around. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/include')
-rw-r--r--drivers/staging/rtl8723bs/include/autoconf.h16
-rw-r--r--drivers/staging/rtl8723bs/include/rtw_debug.h12
2 files changed, 15 insertions, 13 deletions
diff --git a/drivers/staging/rtl8723bs/include/autoconf.h b/drivers/staging/rtl8723bs/include/autoconf.h
index fe220d8bd624..09ed29f4efbd 100644
--- a/drivers/staging/rtl8723bs/include/autoconf.h
+++ b/drivers/staging/rtl8723bs/include/autoconf.h
@@ -21,7 +21,7 @@
/*
* Functions Config
*/
-/* define CONFIG_DEBUG_CFG80211 */
+/* define DEBUG_CFG80211 */
#ifndef CONFIG_WIRELESS_EXT
#error CONFIG_WIRELESS_EXT needs to be enabled for this driver to work
@@ -56,16 +56,18 @@
/*
* Debug Related Config
*/
-#undef CONFIG_DEBUG
+#undef DEBUG
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
#define DBG 1 /* for ODM & BTCOEX debug */
-/*#define CONFIG_DEBUG_RTL871X */
-#else /* !CONFIG_DEBUG */
+/*#define DEBUG_RTL871X */
+#else /* !DEBUG */
#define DBG 0 /* for ODM & BTCOEX debug */
-#endif /* !CONFIG_DEBUG */
+#endif /* !DEBUG */
-#define CONFIG_PROC_DEBUG
+#ifdef CONFIG_PROC_FS
+#define PROC_DEBUG
+#endif
/* define DBG_XMIT_BUF */
/* define DBG_XMIT_BUF_EXT */
diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h
index 7c951df4c979..625e2a39a861 100644
--- a/drivers/staging/rtl8723bs/include/rtw_debug.h
+++ b/drivers/staging/rtl8723bs/include/rtw_debug.h
@@ -206,7 +206,7 @@
#endif /* defined(_dbgdump) */
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
#if defined(_dbgdump)
#undef DBG_871X
#define DBG_871X(...) do {\
@@ -223,9 +223,9 @@
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while (0)
#endif /* defined(_dbgdump) */
-#endif /* CONFIG_DEBUG */
+#endif /* DEBUG */
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
#if defined(_dbgdump) && defined(_MODULE_DEFINE_)
@@ -258,7 +258,7 @@
_dbgdump("\n"); \
}
#endif /* defined(_dbgdump) */
-#endif /* CONFIG_DEBUG_RTL871X */
+#endif /* DEBUG_RTL871X */
#ifdef CONFIG_DBG_COUNTER
#define DBG_COUNTER(counter) counter++
@@ -275,7 +275,7 @@ void mac_reg_dump(void *sel, struct adapter *adapter);
void bb_reg_dump(void *sel, struct adapter *adapter);
void rf_reg_dump(void *sel, struct adapter *adapter);
-#ifdef CONFIG_PROC_DEBUG
+#ifdef PROC_DEBUG
ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
int proc_get_read_reg(struct seq_file *m, void *v);
ssize_t proc_set_read_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
@@ -350,6 +350,6 @@ int proc_get_tx_logs(struct seq_file *m, void *v);
int proc_get_int_logs(struct seq_file *m, void *v);
#endif
-#endif /* CONFIG_PROC_DEBUG */
+#endif /* PROC_DEBUG */
#endif /* __RTW_DEBUG_H__ */