diff options
author | Xiaojie Yuan <xiaojie.yuan@amd.com> | 2020-07-13 07:55:42 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-14 20:38:41 +0200 |
commit | 9987d70d10eea0d685d4bfbf2101eaad64d36c37 (patch) | |
tree | 45cbabc1dd2f4c716d9c0714d0b2d6322cf2387d /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |
parent | drm/amdgpu/powerplay: Modify SMC message name for setting power profile mode (diff) | |
download | linux-9987d70d10eea0d685d4bfbf2101eaad64d36c37.tar.xz linux-9987d70d10eea0d685d4bfbf2101eaad64d36c37.zip |
drm/amdgpu: use ARRAY_SIZE() to add amdgpu debugfs files
to easily add new debugfs file w/o changing the hardcoded list count.
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index b8ce43c28116..58d4c219178a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -781,8 +781,10 @@ int amdgpu_debugfs_fence_init(struct amdgpu_device *adev) { #if defined(CONFIG_DEBUG_FS) if (amdgpu_sriov_vf(adev)) - return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list_sriov, 1); - return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list, 2); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list_sriov, + ARRAY_SIZE(amdgpu_debugfs_fence_list_sriov)); + return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list, + ARRAY_SIZE(amdgpu_debugfs_fence_list)); #else return 0; #endif |