Skip to contentSkip to conversation

drm/amdgpu: fw_attestation: fix unused function warning

PATCH Applied Arnd Bergmann 2 participants 2 messages Dec 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fw_attestation: fix unused function warning

From: Arnd Bergmann <[email protected]>

Without debugfs, the compiler notices one function that is not used at all:

drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:123:12: error: unused function 'amdgpu_is_fw_attestation_supported' [-Werror,-Wunused-function]

In fact the static const amdgpu_fw_attestation_debugfs_ops structure is also unused here, but that warning is currently disabled.

Removing the #ifdef check does the right thing and leads to all of this code to be dropped without warning.

Fixes 19ae333001b3 ("drm/amdgpu: added support for psp fw attestation")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c +0 -2
index e47bca1c7635..7c6e02e35573 100644
@@ -130,7 +130,6 @@ static int amdgpu_is_fw_attestation_supported(struct amdgpu_device *adev)
 
 void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
 {
-#if defined(CONFIG_DEBUG_FS)
 	if (!amdgpu_is_fw_attestation_supported(adev))
 		return;
 
@@ -139,5 +138,4 @@ void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
 			    adev_to_drm(adev)->primary->debugfs_root,
 			    adev,
 			    &amdgpu_fw_attestation_debugfs_ops);
-#endif
 }
Signature · 6 lines
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied
#1 lore raw
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Without debugfs, the compiler notices one function that is not used at all:

drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:123:12: error: unused function 'amdgpu_is_fw_attestation_supported' [-Werror,-Wunused-function]

Quoted 8 lines

In fact the static const amdgpu_fw_attestation_debugfs_ops structure is also unused here, but that warning is currently disabled.

Removing the #ifdef check does the right thing and leads to all of this code to be dropped without warning.

Fixes 19ae333001b3 ("drm/amdgpu: added support for psp fw attestation")

Applied. Thanks!

Alex

Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c +0 -3
index e47bca1c7635..7c6e02e35573 100644
@@ -130,7 +130,6 @@ static int amdgpu_is_fw_attestation_supported(struct amdgpu_device *adev)
 
 void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
 {
-#if defined(CONFIG_DEBUG_FS)
        if (!amdgpu_is_fw_attestation_supported(adev))
                return;
 
@@ -139,5 +138,4 @@ void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
                            adev_to_drm(adev)->primary->debugfs_root,
                            adev,
                            &amdgpu_fw_attestation_debugfs_ops);
-#endif
 }
--

2.27.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx