Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3920706rwi; Sat, 22 Oct 2022 02:14:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BKOIpIFUCaNT5u8rgyEG4dENssYFsRKKshOJoQ0F9Dk9NAXIuI8XBemCgCe1/01etKfLu X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr22542573plh.172.1666430041082; Sat, 22 Oct 2022 02:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430041; cv=none; d=google.com; s=arc-20160816; b=07j7Kfa6t7Y+X1UnWM7M93ROfivcWPliY3CYtDtJ5E/nxWHAGARTUZLIcLQI6R5hFY ZzNln7eWb5je+qob2JvqDG7rUkLFZ1z1U6qPYnDwFaAQUZB/J4D4Jxd10xyrVGLYldd8 NlynYnaN2qcdnaOp1XfbUfMEYvhXRsPWqaPKgHHzIo6WlJUQP/GZ1S3URVcUKIz9lisS 4hL0A/PX662JyaZt7lS7gxyPAqHRUmZfftWcCimREQklpMFBz5fcd2SRiGBvRD13qYpS jOo8ELeQQpp4vcUJf3WWPUvxx8KhELXDSPWRe3R5ZzQ2udxTosEiQX2BY3kpGidMM7o0 oBqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aCrVrmCgsXg/0gj68/SN/ZZ8DR1FtDZ1Blrqf3dGLX8=; b=pVhsBe3mGaMQtN6cBo9626no9VHIQiww+44MzWnMvbhbhXdFgWg7DnoNq3SvDe6hCH HufuoYRh5gL44X5RILxOE6lnzh2O1sQt7RVLGlbqwJ2odzL3IXnIiL7BtFAwOFRngmGb 0AEplY4ZCJOdohrGuNHTFS50hnmn4mTAYBa9dDmG6t+iBOqDGEIPv5hC6kvPECPH7yya 7vsI4yn4q/mTtxY/qfCj3phwaJjJekTx2svY2cQ67hcHjLeyzSkMxqxyWnoxtOTEpVBD Z0S0rpDRc6W4z4TpzD+Tb5XVepUmxDIP0ife58b50p/ssgLT+I8xxNsSKP/YKrRKboM8 u3Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UhWx7ZuL; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a170902820200b0017f9bf47be5si25979181pln.220.2022.10.22.02.13.49; Sat, 22 Oct 2022 02:14:01 -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=@linuxfoundation.org header.s=korg header.b=UhWx7ZuL; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234893AbiJVIuc (ORCPT + 99 others); Sat, 22 Oct 2022 04:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbiJVItM (ORCPT ); Sat, 22 Oct 2022 04:49:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB6211CDCF7; Sat, 22 Oct 2022 01:10:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CA65460ADD; Sat, 22 Oct 2022 08:06:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6A5AC433C1; Sat, 22 Oct 2022 08:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425997; bh=AovMnUVFaDgnuucVmCvW2YnL6/FL1thsQNXgFxRaPiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UhWx7ZuL0GCwf3DQQCRPGWG0E85sH9tVyF78GhaOtezCnoYkPT+SytG6eyJ+SxF5N kVjuo7+AMstmQjZpZAZKgO5Vt7yRkxqFSujerCxmbh8eKlW9jUOHSDjskXVHVuDzGb /SmGJTOOrldwj5Qiy9JW4Qgf5z64FETrXSWLwNe0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , "Steven Rostedt (Google)" , Arun Easi , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.19 683/717] scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled Date: Sat, 22 Oct 2022 09:29:22 +0200 Message-Id: <20221022072528.688051704@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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