From patchwork Thu Jun 22 10:20:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 111614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4974867vqr; Thu, 22 Jun 2023 03:57:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5J9F9odot85wR7Ng4V0FysfLGOrGEsPjLbFyiYZiTSN/s6yqpRtgLDv52yK26cef1xFoUL X-Received: by 2002:a17:903:25c4:b0:1b2:2c8e:5435 with SMTP id jc4-20020a17090325c400b001b22c8e5435mr17180094plb.4.1687431449316; Thu, 22 Jun 2023 03:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687431449; cv=none; d=google.com; s=arc-20160816; b=eOjsclemaknZ/QhHenbt29Mumflb6Cs19M6aRNXJGoh0dFPBmwuXQh3zXKPMBmNfJT P/Ux5cVTyKRAqzCdbaNI1Kuw7O3u/+mXBZmsdfJeirCtRbRKBVqSRTXuG0mLGklMbINq BtnDMziJvXsX+CHZwb4IrrZLE90jqzc75LFykfMW/v4DZfjByVl4Cnhqmq6q0SDQA1DH ihrFhjhijC/Lg9qSOtncYCXcFlvKTn4gxSz6wPm+8RRWh5yzLK5MhM0HM8q/pbTp2ffC JxbcCxtQosPDzAl7KXLoWdTY/KvuabUQOGna91DFT8XlCrUHjnKb7iVPstY/rI/7NJsv fidQ== 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=8Qn0ZpqShdTkxli5WthLFuRJmVyhsgvo4nRlpM9hk2k=; b=rTQcigTa75iAXZ1GJseAsxJyJUzMUEkgGsCtbKsazdtUZowiqPjCjFAy2sD15nDqce oyKD7us1kv0WirsZlfluaYXBVPayC5A6wLxwLlz8CGFfj+xlHfP3BwQXOZDlY+BozIkd dwIH+xW68zw4cnFEO3iAGqTD6aRqWgE9iPylg1Fhyj6h+GJzWOOdAISVadr/FB+mCqSF Z1yTFpn0D7CORb+PkZ6zv6K8Tytn42/Okuay5h7r8YD3x3LUaQZtrunUT8TdkKNYJ13k RUq+BmjMm5gaIaEyz+IapCRNRy14fru00hyiMenjX6kSGE8PPOfGptm5/z2DYNjZb17J EZEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lr5YgX/5"; 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 t3-20020a17090340c300b001b3c40cae6dsi1740916pld.342.2023.06.22.03.57.16; Thu, 22 Jun 2023 03:57:29 -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="lr5YgX/5"; 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 S231364AbjFVKUx (ORCPT + 99 others); Thu, 22 Jun 2023 06:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbjFVKUr (ORCPT ); Thu, 22 Jun 2023 06:20:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66681BE5 for ; Thu, 22 Jun 2023 03:20:43 -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 6E6CA617B6 for ; Thu, 22 Jun 2023 10:20:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92EF0C433C8; Thu, 22 Jun 2023 10:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687429242; bh=AWFPWNjgq8nDENgHhyxRM1ln3/MFL4dH5rZ97ud8+z4=; h=From:To:Cc:Subject:Date:From; b=lr5YgX/5QzEp2HSY7IaidtJuiAoPY0Sdmn1yD8o2RR7TCKFENJqN98bbcvWyw8QL9 dfiQV0eAQMuoDCNzDowXK3NNXkywINA+rE7Seabeig6ooXd5hBLA3d7CNvGCjDQrYg P8+6MAVeTnpurC0pJf5E3yAVtcJgispoud0+yPICWVtfdoNgVZgXIlIaPErK+SMu1s UYsEXR1vvuBUfD/mGPhMoc8vu+ZaHMi3jZbIIEyJxEt5SN6DK6GFRO0nVZONaPXLIn Uz1UmlHVPC+fzNv/xT6h4PkELS+4KVMHuBbwNOQQL7fwk43+7yIKrreShY1PPuew8L 3wrBu96nixZnw== From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Evan Quan , Hawking Zhang , Wenhui Sheng , Guchun Chen Cc: Arnd Bergmann , kernel test robot , Tong Liu01 , Yiqing Yao , ZhenGuo Yin , Jonatas Esteves , Kent Russell , Kun Liu , Asad Kamal , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amdgpu: fix building without DEBUG_FS Date: Thu, 22 Jun 2023 12:20:26 +0200 Message-Id: <20230622102035.3552643-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769400119527703899?= X-GMAIL-MSGID: =?utf-8?q?1769400119527703899?= From: Arnd Bergmann The debugfs file is defined unconditionally, but the registration is hidden in an #ifdef, which causes a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c:110:37: error: unused variable 'amdgpu_rap_debugfs_ops' [-Werror,-Wunused-const-variable] static const struct file_operations amdgpu_rap_debugfs_ops = { ^ in amdgpu_pm.c, the same thing happens with the clocks[] variable: drivers/gpu/drm/amd/pm/amdgpu_pm.c:38:34: error: unused variable 'clocks' [-Werror,-Wunused-const-variable] static const struct cg_flag_name clocks[] = { ^ Since debugfs_create_file() does nothing when debugfs is disabled, removing the ifdefs makes the code more readable and also avoids both warnings. Fixes: a4322e1881bed ("drm/amdgpu: add debugfs interface for RAP test") Fixes: e098bc9612c2b ("drm/amd/pm: optimize the power related source code layout") Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202302200339.Whql7Emr-lkp@intel.com/ Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c | 2 -- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 6 ------ 2 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c index 12010c988c8b5..123bcf5c2bb13 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c @@ -116,7 +116,6 @@ static const struct file_operations amdgpu_rap_debugfs_ops = { void amdgpu_rap_debugfs_init(struct amdgpu_device *adev) { -#if defined(CONFIG_DEBUG_FS) struct drm_minor *minor = adev_to_drm(adev)->primary; if (!adev->psp.rap_context.context.initialized) @@ -124,5 +123,4 @@ void amdgpu_rap_debugfs_init(struct amdgpu_device *adev) debugfs_create_file("rap_test", S_IWUSR, minor->debugfs_root, adev, &amdgpu_rap_debugfs_ops); -#endif } diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index a57952b93e73f..ec39805b762e6 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -3565,8 +3565,6 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) /* * Debugfs info */ -#if defined(CONFIG_DEBUG_FS) - static void amdgpu_debugfs_prints_cpu_info(struct seq_file *m, struct amdgpu_device *adev) { uint16_t *p_val; @@ -3768,11 +3766,8 @@ static const struct file_operations amdgpu_debugfs_pm_prv_buffer_fops = { .llseek = default_llseek, }; -#endif - void amdgpu_debugfs_pm_init(struct amdgpu_device *adev) { -#if defined(CONFIG_DEBUG_FS) struct drm_minor *minor = adev_to_drm(adev)->primary; struct dentry *root = minor->debugfs_root; @@ -3789,5 +3784,4 @@ void amdgpu_debugfs_pm_init(struct amdgpu_device *adev) adev->pm.smu_prv_buffer_size); amdgpu_dpm_stb_debug_fs_init(adev); -#endif }