Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp201475rwi; Wed, 12 Oct 2022 18:38:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hcvEctaT4//vab8ZH4rofyA7EXHvYmUQ6qLoIsWFeZfRWAyKgAtVRat0Vgz4dc2HDMjwE X-Received: by 2002:a05:6402:28ca:b0:43b:5235:f325 with SMTP id ef10-20020a05640228ca00b0043b5235f325mr29671688edb.320.1665625080222; Wed, 12 Oct 2022 18:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665625080; cv=none; d=google.com; s=arc-20160816; b=C1IDju2Vjuiax0JWnRdMaMnt1gQCTaxe8VBzWYfI5ZsB9VRAWB1tCHFhYPpBsoD7QL ZO7q7UnfQQ4TGNGHI/HPCX1hAN6XIktKIlV0FB9s7HAdbLoifscL1yJCBRCkYJDcJ0fq ZV0JqrEP0Nvwp1+NBOsOGH/3upl2226ffI0K2GhtPjA1Pt3PYx71XOaVPNlqy0lG76Cs 0yduKrG1+oIX6soJCPBFIpK5qRuVlzRaA22EoMnR4lShK3AZEcWEDVQe+GFJSiwOPW+M 9RUL31yniIxvIzp/qpqYZXGrd9ycbLBf1T7qmPkCb7yjFEjyUGGW3Y6pswXK7KkVZ4yX CrNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aCrVrmCgsXg/0gj68/SN/ZZ8DR1FtDZ1Blrqf3dGLX8=; b=uOh3EZmct+FIVAjDdpdUpRfsG0J+jpxq75r28u2kp9OleBvTkm0rnPOTxvZGK9o9WL 8pxiuKN30pPyhSgM2eFE/UO8Z3ybRPyyfKNJCbawoOu7BxPf53tywFHgDr7q0xPkKKnp K6Yq7bqKXYo2RIePMwZgK3LL9kVy8ENClTPTCwc7S1i/nh6ABqaT7uSeK8IU3eZyRz12 zbs1s4PuH/W/tYW3GImzXGWR4tTwe7KDTm34ZXegSgRc+Vugml+H9BEbiaxt4deflleY rH8LR5T1NJvL980WImsUgXjX48s8eWTlE7DNsGptjOyHo0D9CpFF2ac/V+zChpmfP6vs njww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pBrSB6+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs37-20020a1709072d2500b0078dd22dd569si7342101ejc.121.2022.10.12.18.37.35; Wed, 12 Oct 2022 18:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pBrSB6+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232023AbiJMA3o (ORCPT + 99 others); Wed, 12 Oct 2022 20:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbiJMA0g (ORCPT ); Wed, 12 Oct 2022 20:26:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6AFD17AB0; Wed, 12 Oct 2022 17:24:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6616FB81CE8; Thu, 13 Oct 2022 00:23:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D269C433D7; Thu, 13 Oct 2022 00:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620593; bh=AovMnUVFaDgnuucVmCvW2YnL6/FL1thsQNXgFxRaPiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBrSB6+QDnx0GPCZO9sGNP+4HCZuI2t+ohfvNUL4InIsMw8PUW/F2aAVtGcOKoZrq XBugzMYVOSV1QdByNw8raNA8TJ5de9Khb0f2p/4cfSQF0QQdY5vcHyfiFZGGQ13lqm rhNz9s0T0ESdBjPcxPyic4wtQHq2F5lTIF847ZLfjQKv4osEJTq/rOwSKCZAI+P9cw Pyv7FOJ9isp5Rlj3pnEuqxfkX+EKAfWc+5ncp2nQdlJwegyp48ttA/DJI/C9JmLeb4 m+I24ADz74J2F/Z9xoALAu4xHPOSzrWDFdw3BaHaaEr5ZeQs0qdHotDhjiKI8yRuRs 94ekwlYyISF8g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arun Easi , kernel test robot , Steven Rostedt , "Martin K . Petersen" , Sasha Levin , mhiramat@kernel.org Subject: [PATCH AUTOSEL 5.15 39/47] scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled Date: Wed, 12 Oct 2022 20:21:14 -0400 Message-Id: <20221013002124.1894077-39-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013002124.1894077-1-sashal@kernel.org> References: <20221013002124.1894077-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arun Easi [ 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@marvell.com Reported-by: kernel test robot Reviewed-by: Steven Rostedt (Google) Signed-off-by: Arun Easi Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- include/linux/trace.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) 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 */ -- 2.35.1