diff mbox series

iwlwifi: mei: fix linking when tracing is not enabled

Message ID 20211201113411.130409-1-emmanuel.grumbach@intel.com
State New
Headers show
Series iwlwifi: mei: fix linking when tracing is not enabled | expand

Commit Message

Emmanuel Grumbach Dec. 1, 2021, 11:34 a.m. UTC
I forgot to add stubs in case tracing is disabled.

Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 .../net/wireless/intel/iwlwifi/mei/trace-data.h    | 13 +++++++++++++
 drivers/net/wireless/intel/iwlwifi/mei/trace.h     | 14 ++++++++++++++
 2 files changed, 27 insertions(+)

Comments

Kalle Valo Dec. 5, 2021, 11:55 a.m. UTC | #1
Emmanuel Grumbach <emmanuel.grumbach@intel.com> wrote:

> I forgot to add stubs in case tracing is disabled which caused linking errors:
> 
> ERROR: modpost: "__SCT__tp_func_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCT__tp_func_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCK__tp_func_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCK__tp_func_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__tracepoint_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCT__tp_func_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> ERROR: modpost: "__SCK__tp_func_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined!
> 
> Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME")
> Reported-by: Jiri Slaby <jirislaby@kernel.org>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Acked-by: Luca Coelho <luciano.coelho@intel.com>

Patch applied to wireless-drivers-next.git, thanks.

fe6db7eda930 iwlwifi: mei: fix linking when tracing is not enabled
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/trace-data.h b/drivers/net/wireless/intel/iwlwifi/mei/trace-data.h
index 0a0078a79c7e..83639c6225ca 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/trace-data.h
+++ b/drivers/net/wireless/intel/iwlwifi/mei/trace-data.h
@@ -3,6 +3,12 @@ 
  * Copyright(c) 2021        Intel Corporation
  */
 
+#if !defined(CONFIG_IWLWIFI_DEVICE_TRACING)
+
+#define trace_iwlmei_sap_data(...)
+
+#else
+
 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_DATA) || defined(TRACE_HEADER_MULTI_READ)
 
 #ifndef __IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_DATA
@@ -60,6 +66,11 @@  TRACE_EVENT(iwlmei_sap_data,
 		  __entry->trace_type, __get_dynamic_array_len(data))
 );
 
+/*
+ * If you add something here, add a stub in case
+ * !defined(CONFIG_IWLWIFI_DEVICE_TRACING)
+ */
+
 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_DATA */
 
 #undef TRACE_INCLUDE_PATH
@@ -67,3 +78,5 @@  TRACE_EVENT(iwlmei_sap_data,
 #undef TRACE_INCLUDE_FILE
 #define TRACE_INCLUDE_FILE trace-data
 #include <trace/define_trace.h>
+
+#endif /* CONFIG_IWLWIFI_DEVICE_TRACING */
diff --git a/drivers/net/wireless/intel/iwlwifi/mei/trace.h b/drivers/net/wireless/intel/iwlwifi/mei/trace.h
index 6f673f2817ad..45ecb22ec84a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/trace.h
+++ b/drivers/net/wireless/intel/iwlwifi/mei/trace.h
@@ -3,6 +3,13 @@ 
  * Copyright(c) 2021        Intel Corporation
  */
 
+#if !defined(CONFIG_IWLWIFI_DEVICE_TRACING)
+
+#define trace_iwlmei_sap_cmd(...)
+#define trace_iwlmei_me_msg(...)
+
+#else
+
 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_CMD) || defined(TRACE_HEADER_MULTI_READ)
 #define __IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_CMD
 
@@ -53,6 +60,11 @@  TRACE_EVENT(iwlmei_me_msg,
 		  __entry->type, __entry->seq_num)
 );
 
+/*
+ * If you add something here, add a stub in case
+ * !defined(CONFIG_IWLWIFI_DEVICE_TRACING)
+ */
+
 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI_SAP_CMD */
 
 #undef TRACE_INCLUDE_PATH
@@ -60,3 +72,5 @@  TRACE_EVENT(iwlmei_me_msg,
 #undef TRACE_INCLUDE_FILE
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
+
+#endif /* CONFIG_IWLWIFI_DEVICE_TRACING */