Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1096077pxa; Thu, 20 Aug 2020 02:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMmDsqh7QjQmPwM5IvaNfmLVm79uEeyWB0hV4nsfz3jpn+KtFeHUA3A7BVBIV2UMjy+v5p X-Received: by 2002:a17:907:2119:: with SMTP id qn25mr2299126ejb.278.1597915048546; Thu, 20 Aug 2020 02:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597915048; cv=none; d=google.com; s=arc-20160816; b=HroQbPOUlsfe3HIj38GvGixFT0/ks0uRKNNDg8LBDdap4yXIh7tXqf9Z0vfsFTm/vP gdjr3HYzsGYTiqXx1/V5RpM+Mwlxz0IugtIjINTDQmlb28mKTuUkQlsGP08mqyhyHqLK gSdGBRfhWA8SIUCmZPMPlQrnN1+NCBfNPIQRlKuXwDr1KkGW33nnEAHxabNtlREFAx1P PKzxtdpaAKspzrip67rSs2v6gsKq04JzaZus2anBvwGEojaAnMtpN5DHfH+vIq1h6sLd KCGxwg3QAoNKxPVywcmamxMYZHTmexbuG+rutgOTJT21c5QO67WnC6DmB8Zyyvrh5vsn 1LQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iKNU74NJdZK5cyzQFbM7uQHSgaBwB5CboR+e0oglByo=; b=DGTtGOsAqWYdVEiPAgzcYBPecsFjALmErjpXhYYUoWJtTcbGOEAzZGtQ+bEMBE7zwZ vvBbA7LQjLVISp3QQs/gz62ltI5a/xDEKn6Yu/h36JzKcoFNfB9/wxkz//pjJbtlVyeo smNKbz7zmdS6eu2/Kg8Sl9Q2FozrVl9Lo3/9gEF1WsVMR7WatCuCUkrfRi6GT4T+v2mh Ts09TT2Sy8WHfn1R5ohIej3haz1ga/MlzN7EQwkxhViGeiJgbMYy8mx5yFUrcAeBZ6PO yIj+q+jP2GvRz37WTeqyXkuEc+sUInHMNZ+hjMoRfwkVvLZjKTm09yVIixDlbBWbsCy9 6MFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f53NuOrs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc16si776750ejb.746.2020.08.20.02.17.04; Thu, 20 Aug 2020 02:17:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f53NuOrs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgHTJPc (ORCPT + 99 others); Thu, 20 Aug 2020 05:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbgHTJOb (ORCPT ); Thu, 20 Aug 2020 05:14:31 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA87C061343 for ; Thu, 20 Aug 2020 02:14:27 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id y206so708553pfb.10 for ; Thu, 20 Aug 2020 02:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iKNU74NJdZK5cyzQFbM7uQHSgaBwB5CboR+e0oglByo=; b=f53NuOrsS3mDzLLgHf/lVcMv2rI0XJgW2xMiLctDDBFzrksxOqhcTxm1XIVQnBQkE5 +kMAMDdXzLKtSit04ro2JszrQPyd+kMW6DQyX3Fqi5F4PZDe779pikdz44FcUDrjmvQc jjFTXmzw429GB5mNaBH2Jij5WbpAtdFvjw+D8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iKNU74NJdZK5cyzQFbM7uQHSgaBwB5CboR+e0oglByo=; b=h3STQDsZxd9yoh9nO7iE/KqpHysdsbAT43hxMXXVI8n2KrhfAuvuFbpVeWarAxJ5Ai G7OnI6fBhjUze8M3z+oQUjSwAh3BbtpqVtSyjAPu7GMHcdlTZ2ZN8ol5vGN4Q+MY5p6L JhqPgmOFQguRwjE0YdsB/v4LuN3Qo937XDCvNCGC6LkE451W1sYkaucLG43W7rXsjOUh aiolyzPiRT6ckpJ32X70qr8ALMsfzgulp23MnRm5fvYmzFrA9JpIHQ3LCc5BujrnMN4+ xMKGp7BgJEAwW3yD2N2W3zRW9KXY3v/lSJtxsdb74Cpq8FkbEiLtr6mN1hLn++gmTy7H 8Wkg== X-Gm-Message-State: AOAM532+t0SmuCXPZCxJlRnWRMgGnuUm8+e2epTBhOg6vSSGmJQorrT5 Sf5DQco/OtxR/l+aA2NTSaQ9zA== X-Received: by 2002:a62:7bcf:: with SMTP id w198mr1569326pfc.90.1597914866996; Thu, 20 Aug 2020 02:14:26 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:7220:84ff:fe09:41dc]) by smtp.gmail.com with ESMTPSA id o15sm1954448pfu.167.2020.08.20.02.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 02:14:26 -0700 (PDT) From: Nicolas Boichat To: Mauro Carvalho Chehab , Steven Rostedt , Greg Kroah-Hartman Cc: Nicolas Boichat , Andy Shevchenko , Sakari Ailus , 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 Message-Id: <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog In-Reply-To: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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