Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp452862rwr; Wed, 3 May 2023 00:45:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+AuR1Cg9v3xITAqVkFBwufdd2mG8sM3DLrLqDHMdAtHMxaYtY6FUWYlNweFp/WrJogwDw X-Received: by 2002:a05:6a20:12c4:b0:f3:3ab1:e34a with SMTP id v4-20020a056a2012c400b000f33ab1e34amr27762714pzg.29.1683099934792; Wed, 03 May 2023 00:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099934; cv=none; d=google.com; s=arc-20160816; b=Xf1RaeCi5sLFCEtOl9dUZ9x5m5MYVzBJT7Yh7siBtIxfuJZWb4whUfw8TxmI1SO4bx lqKcbWb+eULKiXOYlghSwlTJGAC2EHD+4PNGTJzGVS4pkGX6Lddl9AQEoukFcqJAwtKZ n5vke5AwPZCEO2EjsCf3XLP2ZWRipgdAbn16MiRhhI6AQaLdAT6pCIMDJ+zWSsCJ69C9 h4mSmJa00bXYHdKY/HC9syQ43Y+TLqk/Xd1UvEOtyXZ2tSxHXuzWYtDSlqU4vkBfABX2 R/1zFyn7YOVrSn0a4AwqzNYL1jLNXSBXEXmzllhREDbK6lK6GRfK0oQ3jS1okJsMK8Jp GAOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GJV74MDW5y+ACVn3WrwP3elljkzjXGgh8VAriWHOGeU=; b=MijGOubPbUgmlxAkJRwAvf/KDN5h+KKBN+ZJOa+jgCNWLa4SLPkTxAuLn1NULzE/GU vfhiYVsLH9uFl8H54/ReNnBFcyVG4Xv69a/lsoFEhXNrtMFSArr/TjOAhcB/kqN+lteR ibhfy5vQGDQ8aEb+09hT0GhowqZOMyqrS8L8M+VzlUUiY7oThCeSypvj7OnQl8QyjATt IA8P2qY844iLnkyGyPWBQhsftQIfJv/sflAwtYI7RVvcxH5Lo74XlS4x4av/Jg08bBH0 oQ5/Ihgjhn2e1L7z6hXlkH0ioFZJR1xkdjXQ+91fs8GOZb50i9641RZBhFD5SgamkjXb V72A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20221208.gappssmtp.com header.s=20221208 header.b=oRTVtBH8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a632b11000000b0050be2ca268csi30938666pgr.762.2023.05.03.00.45.19; Wed, 03 May 2023 00:45:34 -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=@resnulli-us.20221208.gappssmtp.com header.s=20221208 header.b=oRTVtBH8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbjECHgQ (ORCPT + 99 others); Wed, 3 May 2023 03:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjECHgH (ORCPT ); Wed, 3 May 2023 03:36:07 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 023E940FD for ; Wed, 3 May 2023 00:36:04 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f19afc4fd8so29188935e9.2 for ; Wed, 03 May 2023 00:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20221208.gappssmtp.com; s=20221208; t=1683099362; x=1685691362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GJV74MDW5y+ACVn3WrwP3elljkzjXGgh8VAriWHOGeU=; b=oRTVtBH8IYjN1lZYq9pa8LDdL/WzfkKlBG88g6SiHg2KoWXgvSrP85lRErVAZH5GED XBZwfbCNrlYtuQ6walbqhauG/y8NSiv29JvivN2qWePFu572bX6inRsHgCZsgYnEQqxG z1dx3MjfbfvOojAP8Vpz3UlA9XgU47SN91XBy9hrAD104hkXCwvGxYf3kkDzLgnQteKe 7BDak7Id5tYHZlPVhFOBtallmAAmpOgRHCVlb5mZUO0gUA5tm4CxoYcEZDISjbjYzKxZ YxlfCq/mmJKYKe1C5l5daDd7v/uzbqSb/kLr/LcXhAlzpirXh0XfvMs4nPSHJz08emWI L4zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683099362; x=1685691362; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GJV74MDW5y+ACVn3WrwP3elljkzjXGgh8VAriWHOGeU=; b=j+A9iC476wAJf5OpHayfpWZgLCv6+zkJvlBZ2xUGZPxcGtTGi7ivB1JbkfVuZCEzNN zOEUwAkWcvO7BJRvpbKGnaI2KgdK33HiFBRnQJ1RXwc1wKNYpktQk+dgu5ckVHPtF+FN rY8/Y22Amzm1iJL2EoT95p1EBS3Rukmj26Fbt0onvChCp//32f6MCqaVKFwxUxfNo7Ws tlqSWbEIwdDadW65daaOtmtcHOdL0J4UqbLTi5aKlNdaTWRUpchzWn+CJFjXtZAiS3UL SMPqWWWxttPEhK926kNKKzTEPcR0DwPjFMi4T8Fq5Lyitbk+5L1yJXqtLQOYuONExvN3 64qQ== X-Gm-Message-State: AC+VfDxcULVqBoQdOwvCz6DyUaDlHwDGVstWXvPd0pDEPUvOvfKespMr UzKcS2XtgKLGZxAQrkCFMizkfg== X-Received: by 2002:a05:600c:22d2:b0:3f1:6fef:9862 with SMTP id 18-20020a05600c22d200b003f16fef9862mr14051393wmg.13.1683099362288; Wed, 03 May 2023 00:36:02 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id o19-20020a1c7513000000b003f31cb7a203sm1010153wmc.14.2023.05.03.00.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:36:01 -0700 (PDT) Date: Wed, 3 May 2023 09:36:00 +0200 From: Jiri Pirko To: Tom Rix Cc: shannon.nelson@amd.com, brett.creeley@amd.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS Message-ID: References: <20230502145220.2927464-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230502145220.2927464-1-trix@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, May 02, 2023 at 04:52:20PM CEST, trix@redhat.com wrote: >When CONFIG_DEBUG_FS is not defined there is this representative link error >ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove': >main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev > >Avoid these link errors when CONFIG_DEBUG_FS is not defined by >providing some empty macros. > >Signed-off-by: Tom Rix >--- > drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h >index e545fafc4819..0b39a6dc65c8 100644 >--- a/drivers/net/ethernet/amd/pds_core/core.h >+++ b/drivers/net/ethernet/amd/pds_core/core.h >@@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id, > > void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num); > >+#ifdef CONFIG_DEBUG_FS > void pdsc_debugfs_create(void); > void pdsc_debugfs_destroy(void); > void pdsc_debugfs_add_dev(struct pdsc *pdsc); >@@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc); > void pdsc_debugfs_add_irqs(struct pdsc *pdsc); > void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq); > void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq); >+#else >+#define pdsc_debugfs_create() >+#define pdsc_debugfs_destroy() >+#define pdsc_debugfs_add_dev(pdsc) >+#define pdsc_debugfs_del_dev(pdsc) >+#define pdsc_debugfs_add_ident(pdsc) >+#define pdsc_debugfs_add_viftype(pdsc) >+#define pdsc_debugfs_add_irqs(pdsc) >+#define pdsc_debugfs_add_qcq(pdsc, qcq) >+#define pdsc_debugfs_del_qcq(qcq) Usually this is done using static inline stub functions. Any reason to not to do it in the same way? >+#endif > > int pdsc_err_to_errno(enum pds_core_status_code code); > bool pdsc_is_fw_running(struct pdsc *pdsc); >-- >2.27.0 >