Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp320860qtb; Wed, 19 Oct 2022 02:52:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uptBmNNJq5lID/QeTZQKVKsjb43eZWfnslw29HVEV6QTl3RpDf8fQyB/f26QmPJUwiZ86 X-Received: by 2002:a05:6402:4312:b0:45c:c1e9:9dc8 with SMTP id m18-20020a056402431200b0045cc1e99dc8mr6648599edc.154.1666173168949; Wed, 19 Oct 2022 02:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666173168; cv=none; d=google.com; s=arc-20160816; b=pauMLp/Tw2ReOfTxpbUi3cTAvGbp7bAP4WJyQgWf/k0PA45+1upU9vv1N3xRX0KM6u MBkFmv3JwAfNYI/h/vE/is+awX5mJOAcS0z9oG51oRk+wb5ZQlTnH+YPDbGRiLjZj19E CwvY/UCVEGWxlkdqhfVtZGR/V8cMHxzmzNzcTAh+I5XIgfhbqpwTG2an44U9m7pyVEJP K9xZK3J56GcJhmyN0VsM6fD9DPy4nFv1wKzMc7r3o5nDNzzUO6PpgOxDQWtxw6IUFnsy R1ewkmjpJKSo2ReRf7NNeazvBmbEp7uVncVJbJ6d4+d64/Sn+bFtOwdmMGuhIMzAjCJN /m8A== 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=ocpxcY1MH1ivZPzJ9W9imkEqe3GXXi1wRemk0uf5jgcHPvIdhnA/1kR9Txn/cH5JH9 tUF/9FMHPR3LoH2e45XE7F2NwY11QWXrZnjMqENCoFNRQUOL5MKuoSDa57ce7zydNYVm E8kzgCPphXI0/gzMAMTHkbRmvYz/ARYU2ymqAnEYdas4S5LvWNospP4JPKiitAenpOgq reatgOkyTMH5OknIlkoem2eQaA2N00+c6CqlX8+4bRNudZ6S9W/cIXoRhDutXCWKVhGu W4RS13ldZIJ9EssPSiwFwFysfpHQgBUWHcvU49tjRMac6xH34Woo/+U0unZIk+3uIDAC DtmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZqwEmFOa; 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 hs21-20020a1709073e9500b0073d8b93700csi14202847ejc.165.2022.10.19.02.52.22; Wed, 19 Oct 2022 02:52:48 -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=ZqwEmFOa; 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 S234301AbiJSJpb (ORCPT + 99 others); Wed, 19 Oct 2022 05:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234237AbiJSJj0 (ORCPT ); Wed, 19 Oct 2022 05:39:26 -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 17F8CEE0B6; Wed, 19 Oct 2022 02:16:12 -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 94B3B61750; Wed, 19 Oct 2022 09:14:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC9A4C433D6; Wed, 19 Oct 2022 09:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170890; bh=AovMnUVFaDgnuucVmCvW2YnL6/FL1thsQNXgFxRaPiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZqwEmFOaz8ofhCSS8VEJVXc2HlICKVOBTSxc+71SsZw5yQ/Iasmjsl3nrp444EzA/ v4D6OApHYLschNKZl2adGHm3e8D49yGusSJSTw+36te5umqXeugOK/n/X/ZvH3AhP9 WicW6ONDObuPzlsh8+THo46VjiHRmYlM+qtbHbOE= 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 6.0 826/862] scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled Date: Wed, 19 Oct 2022 10:35:13 +0200 Message-Id: <20221019083326.403995743@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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