linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Boichat <drinkcat@chromium.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nicolas Boichat <drinkcat@chromium.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed
Date: Thu, 20 Aug 2020 17:14:12 +0800	[thread overview]
Message-ID: <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> (raw)
In-Reply-To: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid>

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@chromium.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


  reply	other threads:[~2020-08-20  9:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  9:14 [PATCH v4 1/3, RESEND] media: camss: vfe: Use trace_printk for debugging only Nicolas Boichat
2020-08-20  9:14 ` Nicolas Boichat [this message]
2020-08-20 14:23   ` [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed Steven Rostedt
2020-08-21  0:13     ` Nicolas Boichat
2020-08-21  0:36       ` Steven Rostedt
2020-08-21  1:39         ` Nicolas Boichat
2020-08-21  1:57           ` Steven Rostedt
2020-08-21  2:36             ` Joe Perches
2020-08-21  2:42               ` Nicolas Boichat
2020-08-21  2:49                 ` Joe Perches
2020-08-21  3:04                   ` Steven Rostedt
2020-08-21  3:08                     ` Steven Rostedt
2020-08-21  2:44               ` Steven Rostedt
2020-08-21  2:39             ` Nicolas Boichat
2020-08-21  3:01               ` Steven Rostedt
2020-08-21 12:19                 ` Nicolas Boichat
2020-08-21  8:48         ` David Laight
2020-08-21 10:27           ` Nicolas Boichat
2020-08-21 11:32             ` David Laight
2020-08-21 12:07               ` Nicolas Boichat
2020-08-21 12:18                 ` David Laight
2020-08-21 12:37                   ` Nicolas Boichat
2020-08-20 14:21 ` [PATCH v4 1/3, RESEND] media: camss: vfe: Use trace_printk for debugging only Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid \
    --to=drinkcat@chromium.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).