Patch "scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-tracing-fix-compile-error-in-trace_array-calls-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6dfe3990e4f450d8abae8ddb71ba0a20651877af
Author: Arun Easi <aeasi@xxxxxxxxxxx>
Date:   Wed Sep 7 16:33:08 2022 -0700

    scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled
    
    [ Upstream commit 1a77dd1c2bb5d4a58c16d198cf593720787c02e4 ]
    
    Fix this compilation error seen when CONFIG_TRACING is not enabled:
    
    drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_init':
    drivers/scsi/qla2xxx/qla_os.c:2854:25: error: implicit declaration of function
    'trace_array_get_by_name'; did you mean 'trace_array_set_clr_event'?
    [-Werror=implicit-function-declaration]
     2854 |         qla_trc_array = trace_array_get_by_name("qla2xxx");
          |                         ^~~~~~~~~~~~~~~~~~~~~~~
          |                         trace_array_set_clr_event
    
    drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_uninit':
    drivers/scsi/qla2xxx/qla_os.c:2869:9: error: implicit declaration of function
    'trace_array_put' [-Werror=implicit-function-declaration]
     2869 |         trace_array_put(qla_trc_array);
          |         ^~~~~~~~~~~~~~~
    
    Link: https://lore.kernel.org/r/20220907233308.4153-2-aeasi@xxxxxxxxxxx
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Arun Easi <aeasi@xxxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/trace.h b/include/linux/trace.h
index bf169612ffe1..b5e16e438448 100644
--- a/include/linux/trace.h
+++ b/include/linux/trace.h
@@ -2,8 +2,6 @@
 #ifndef _LINUX_TRACE_H
 #define _LINUX_TRACE_H
 
-#ifdef CONFIG_TRACING
-
 #define TRACE_EXPORT_FUNCTION	BIT(0)
 #define TRACE_EXPORT_EVENT	BIT(1)
 #define TRACE_EXPORT_MARKER	BIT(2)
@@ -28,6 +26,8 @@ struct trace_export {
 	int flags;
 };
 
+#ifdef CONFIG_TRACING
+
 int register_ftrace_export(struct trace_export *export);
 int unregister_ftrace_export(struct trace_export *export);
 
@@ -48,6 +48,38 @@ void osnoise_arch_unregister(void);
 void osnoise_trace_irq_entry(int id);
 void osnoise_trace_irq_exit(int id, const char *desc);
 
+#else /* CONFIG_TRACING */
+static inline int register_ftrace_export(struct trace_export *export)
+{
+	return -EINVAL;
+}
+static inline int unregister_ftrace_export(struct trace_export *export)
+{
+	return 0;
+}
+static inline void trace_printk_init_buffers(void)
+{
+}
+static inline int trace_array_printk(struct trace_array *tr, unsigned long ip,
+				     const char *fmt, ...)
+{
+	return 0;
+}
+static inline int trace_array_init_printk(struct trace_array *tr)
+{
+	return -EINVAL;
+}
+static inline void trace_array_put(struct trace_array *tr)
+{
+}
+static inline struct trace_array *trace_array_get_by_name(const char *name)
+{
+	return NULL;
+}
+static inline int trace_array_destroy(struct trace_array *tr)
+{
+	return 0;
+}
 #endif	/* CONFIG_TRACING */
 
 #endif	/* _LINUX_TRACE_H */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux