diff options
author | yipechai <YiPeng.Chai@amd.com> | 2022-01-13 06:01:17 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-01-15 01:52:26 +0300 |
commit | 954ea6aa1545a13036851327b4ed251fa7ab2f22 (patch) | |
tree | d632e9713a75fb9bb50d43302c4a6ecde99958dc /drivers/gpu/drm | |
parent | ab3b9de65bfeded1d4646c9f66897c163e89abd8 (diff) | |
download | linux-954ea6aa1545a13036851327b4ed251fa7ab2f22.tar.xz |
drm/amdgpu: Use ARRAY_SIZE to get array length
Use ARRAY_SIZE to get array length.
Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index d37b09b2d33a..9864f730b958 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -89,7 +89,8 @@ const char *get_ras_block_str(struct ras_common_if *ras_block) return ras_block_string[ras_block->block]; } -#define ras_block_str(_BLOCK_) (((_BLOCK_) < (sizeof(*ras_block_string)/sizeof(const char*))) ? ras_block_string[_BLOCK_] : "Out Of Range") +#define ras_block_str(_BLOCK_) \ + (((_BLOCK_) < ARRAY_SIZE(ras_block_string)) ? ras_block_string[_BLOCK_] : "Out Of Range") #define ras_err_str(i) (ras_error_string[ffs(i)]) |