Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp179412rwi; Wed, 12 Oct 2022 18:12:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YCmBwR3V3rFiKF2s0ZrZDBeqHisrdtNKUPivrrl3o9LvUn4mBfaBilRxPSRa5dehb945k X-Received: by 2002:a17:906:dac9:b0:780:ab6f:591f with SMTP id xi9-20020a170906dac900b00780ab6f591fmr24631439ejb.77.1665623520594; Wed, 12 Oct 2022 18:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665623520; cv=none; d=google.com; s=arc-20160816; b=Qee/XSrrzD7/L3QOoCH5VAbBh1BqT3tUd/E2qLDZm5et5CXjN9h/oOcgIkaOX29zt7 JM2K+ngg4H5cx5hwRF/4f4m8zz/4qFgetifN/yNB3wqROYWMJLD9sgIRrWaroOFFo0Tt iNdoecMpf9UNxf5A6kVoUEnAHEOjP0yU4jyluoben+QukcEEkM2VZ0VF+8p2+0z4Ma1g uXfHdiH1oC28s1d6e1IsSB/pF3Bd/fTUzV9rKq8vbVnluzwMu56c7unYyFqip/yVW6vY IW8W0wLPlzmRoRA8jo/kyFbn9xBgpL3azkVdztICTZokjvnVvlev0daKU5i3qyzG2d+W FVUg== 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=GWY/HmTRe8c8UH62O/r2b+TrGcssGJcVWce68HDLIWEEYZzaAAz+JmElmmO6Lzb9XU m9EtENfNWYwRN/sg2cw9y4lh+mbci6iyYl9agpP5lczRpuugTIP372hA9CjbY4ITy65g ODvQNjUB76Z2SG4L+M8dtT28DS/CnSwXfua6flDBxA1gWg2NQWsU30TgC52oD7Z6x4yP 6WhYwLUJKK6WFPNmapg4D23uyWfmv1XH6jeAHTack6FkximdFHUISLFDphGrhG4RfuEj UrFqUPEQv9p7jwtw8uh18XBGavGqix5PekxXz977OrGhNGZsNJNqIlN/dd3ycMqiJKZU rZcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EH4o7+m3; 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 l15-20020a170906794f00b0078cb08c3727si18537955ejo.916.2022.10.12.18.11.34; Wed, 12 Oct 2022 18:12: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=EH4o7+m3; 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 S230199AbiJMAWg (ORCPT + 99 others); Wed, 12 Oct 2022 20:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbiJMAVm (ORCPT ); Wed, 12 Oct 2022 20:21:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96B3F123443; Wed, 12 Oct 2022 17:18:26 -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 4E4E8B81CC0; Thu, 13 Oct 2022 00:18:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F529C43470; Thu, 13 Oct 2022 00:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620280; bh=AovMnUVFaDgnuucVmCvW2YnL6/FL1thsQNXgFxRaPiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EH4o7+m30oWtMSV+gTxWHPkOTPxiRyPis+qePNI5ML/gLc/D4yJr7/MAl+oua6/XV xVajORPwrHQCuJQSN9uJUErL+R93GLLKHfpMbUcnxnf4pW2oM+nShVtguXtmSynivT ZzfYUU17kMgCEStzO7bJ/bNFNd2SgLZGRxtGeQP3po9e/lVkqXd2xxLB/x7IjPSEWE IFJwPU3Ni9A4TpzRRkOBPOlh5WSi344B0VuAp4aNSWe/dPQKvpWznH7xQjg5lbdqwy 9BAvjE0gMXI6F71+xS8WoQFxzpsx6LHU1YqZyoSJe+87un5CvLtMaFxHWC/omagzLq gfHdaoZ5iVF8Q== 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 6.0 50/67] scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled Date: Wed, 12 Oct 2022 20:15:31 -0400 Message-Id: <20221013001554.1892206-50-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-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