From patchwork Wed Jul 19 19:40:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 122794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2677663vqt; Wed, 19 Jul 2023 13:07:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUXFdqMiU5HqpoGBjhLJbrQB6U7s0cTT/Glq2OgOuAteedUtzSRXLiPgREnG/WRxNAP25r X-Received: by 2002:a17:906:15d:b0:993:ea6b:edf6 with SMTP id 29-20020a170906015d00b00993ea6bedf6mr3150389ejh.0.1689797225227; Wed, 19 Jul 2023 13:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689797225; cv=none; d=google.com; s=arc-20160816; b=aCGleC/ssqRsQdvi2uBGhbDY2f+JPm6RM3UrsyKB3crFfwNuiunt0gvnc/A1ryagZ0 XluFJ26CItZn7r47FFKD3VJoJhUasPttNm6v4EBjO9cJa9gjom7H2yJBunrql6i/VrLd pbr/nH+KG/g7c+A46sJTPYkERNgUcm5+4s3ktAZ6N5say+LI8pWhvcvwZsGikRtkHF85 m98EqJU7ubdnTlbGIlFXOwBTOGbznDhBZLJKS9GHd3gmTHKqj96pUyctos+QPYJFVljo bU57IhOSe5KuBn/Jl+LCofCpdemCy0Yay3RYUeFUX504st2DHpGPWaXZRaoSB4zKkG9E jTFw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=FKPF07Q59S6iVhcK2WLYym1W2gLKB3qR2jAWnUrF7/w=; fh=WlmCYzjjnvXw4zPHcBcJc4BvyjySBBXPqzESW3bVG4g=; b=uGvLN1jj+NnkyyFLLamM/lowYaoyRCxGW+K4vI39JUAJlqDOjDqXisZHL+IhLMLOqR CDrPbRN4M5hv4+2FWORvpWs03+PXj6Y3uwdwEU4GudQ2m7bBDAs5+c8qUbUqOP5XzqjG QaJeeGCbFkyve0EDPOClBT7RvGhaXZzkFkrdGLpuqGMZURoxQ8/qjpUy2dl4wvRM+ihk +9DVDIAAB/qLANo074DcKNNB4DcmfM5m6Vf4u+CT/oDIroxlmnw1uH5WE0sTCxUcyy82 KN8h3lXlBGHphKUowMJKMIvPdTUGNZxOONTHVZ+woImG3kKuubeJ9Pt4AL8u3NTQtyEX jQxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=glJtml9m; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt18-20020a170906dfd200b0098da8d0ce54si3335857ejc.834.2023.07.19.13.06.41; Wed, 19 Jul 2023 13:07:05 -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=glJtml9m; 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 S229941AbjGSTlG (ORCPT + 99 others); Wed, 19 Jul 2023 15:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbjGSTlF (ORCPT ); Wed, 19 Jul 2023 15:41:05 -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 40F521FCD for ; Wed, 19 Jul 2023 12:41:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C7A58617DA for ; Wed, 19 Jul 2023 19:41:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B04EC433C7; Wed, 19 Jul 2023 19:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689795663; bh=HT6NIJnJjP5XXjL3jAn8RBEdx6VjahZqEGc1GycJOzs=; h=From:To:Cc:Subject:Date:From; b=glJtml9m0Hgxx78mdXgcgYqU8Aq4I+4WSEAyiStrCFQ6CwHaDQufqKPeshdn1Pu02 oFYhSswF5yw8PkhEan5XX1ffIV79x44ZeWHxfDT4Krxj2oNwuED3/sNk+pTRO7+LsR psri1Wn6WwIu9gKrAKAMIKmya2dEXFgMk1GH6LWhwQeyJbd4fEZsmWqT6nL+oPDi3A gNWZrvm0k1exHt07nf/8pM8LOqmwU8bODbgwkNU8Vo3CueJjgofJSs42P9soDODaFT NumZ1Loz0WGBO7Bvvqm3AEtHnCOgyDOmUfdv5mjOjQL/jprXnXJcd8EKnSAWAU784h 3S1rE3mcdV7ug== From: Arnd Bergmann To: "Michael S. Tsirkin" , Jason Wang , Shannon Nelson Cc: Arnd Bergmann , Xuan Zhuo , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] vpda: pds: fix building without debugfs Date: Wed, 19 Jul 2023 21:40:52 +0200 Message-Id: <20230719194058.1606869-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771880815073276968 X-GMAIL-MSGID: 1771880815073276968 From: Arnd Bergmann The new debugfs code still gets called when debugfs is disabled, resulting in a link failure: ERROR: modpost: "pds_vdpa_debugfs_del_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_add_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_reset_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_create" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_add_ident" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_destroy" [drivers/vdpa/pds/pds_vdpa.ko] undefined! ERROR: modpost: "pds_vdpa_debugfs_add_pcidev" [drivers/vdpa/pds/pds_vdpa.ko] undefined! Add the usual #if/#else block around the declarations to supply empty stubs for the broken case. Fixes: 151cc834f3dda ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Arnd Bergmann --- drivers/vdpa/pds/debugfs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/vdpa/pds/debugfs.h b/drivers/vdpa/pds/debugfs.h index c088a4e8f1e92..6fbd64ace13a3 100644 --- a/drivers/vdpa/pds/debugfs.h +++ b/drivers/vdpa/pds/debugfs.h @@ -6,6 +6,7 @@ #include +#ifdef CONFIG_DEBUG_FS void pds_vdpa_debugfs_create(void); void pds_vdpa_debugfs_destroy(void); void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux); @@ -13,5 +14,14 @@ void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux); void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux); void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux); void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux); +#else +static inline void pds_vdpa_debugfs_create(void) { } +static inline void pds_vdpa_debugfs_destroy(void) { } +static inline void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux) { } +static inline void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux) { } +static inline void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux) { } +static inline void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux) { } +static inline void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux) { } +#endif #endif /* _PDS_VDPA_DEBUGFS_H_ */