[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid>
Date: Thu, 20 Aug 2020 17:14:12 +0800
From: Nicolas Boichat <drinkcat@...omium.org>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Nicolas Boichat <drinkcat@...omium.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org
Subject: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed
We added a config option CONFIG_TRACING_ALLOW_PRINTK to make sure
that no extra trace_printk gets added to the kernel, let's use
that in this driver to guard the trace_printk call.
Signed-off-by: Nicolas Boichat <drinkcat@...omium.org>
---
Technically, we could only initialize the trace_printk buffers
when the print env is switched, to avoid the build error and
unconditional boot-time warning, but I assume this printing
framework will eventually get removed when the driver moves out
of staging?
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 1b2b2c68025b4cc..020519dca1324ab 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -165,11 +165,13 @@ static int atomisp_css2_dbg_print(const char *fmt, va_list args)
return 0;
}
+#ifdef CONFIG_TRACING_ALLOW_PRINTK
static int atomisp_css2_dbg_ftrace_print(const char *fmt, va_list args)
{
ftrace_vprintk(fmt, args);
return 0;
}
+#endif
static int atomisp_css2_err_print(const char *fmt, va_list args)
{
@@ -865,9 +867,11 @@ static inline int __set_css_print_env(struct atomisp_device *isp, int opt)
if (opt == 0)
isp->css_env.isp_css_env.print_env.debug_print = NULL;
+#ifdef CONFIG_TRACING_ALLOW_PRINTK
else if (opt == 1)
isp->css_env.isp_css_env.print_env.debug_print =
atomisp_css2_dbg_ftrace_print;
+#endif
else if (opt == 2)
isp->css_env.isp_css_env.print_env.debug_print =
atomisp_css2_dbg_print;
--
2.28.0.220.ged08abb693-goog
Powered by blists - more mailing lists