From patchwork Sat Oct 22 07:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7731 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1110142wrr; Sat, 22 Oct 2022 01:51:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tpOcRdzegNkSGI7hm6EaT4RwUxcL0yzTHJc8+6kh7OQGFB/xrHdtyB8LyDICFM6Qj6uZA X-Received: by 2002:a17:907:7e9a:b0:796:7a21:1520 with SMTP id qb26-20020a1709077e9a00b007967a211520mr13204123ejc.236.1666428691529; Sat, 22 Oct 2022 01:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428691; cv=none; d=google.com; s=arc-20160816; b=t9oA3RJViiFmBiO0nAFtabBEDyjBEFHeZCEZvy9DiRJf+DbrGjV+t9hUe7YtLwK2nE gPjatihlkH1xnt485VyQR7ZF2R96HeQmbyDdpVwOxGlD6GxpQPwzFH75vtoDjftbUnCT uECkcSwIOm+y+3B00tWuEJZnJJBQgSZmGaaL/+1nBU1aGLSa2vzjAGefQLGTDJ0oNiAt Xg0a5YE1vp+IH3+5Rv8cBj04EzeVsuznFubO7iYJ/cbMooCV4U3+J2osM+kKda69rnlG D7ecQzKdaXb2CA2ZocYuvjeff2agQprRbFmILIPsFr7EiGE+am21HnCOveF0iA0VuZQB 1HgQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ev16-20020a056402541000b004596d6e78e3si18603469edb.144.2022.10.22.01.51.07; Sat, 22 Oct 2022 01:51:31 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747377131822728620?= X-GMAIL-MSGID: =?utf-8?q?1747377131822728620?= 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 */