diff options
author | Muhammad Falak R Wani <falakreyaz@gmail.com> | 2016-05-13 19:36:40 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-16 18:17:25 +0200 |
commit | a7aabcc8a5f5e7834abb538ad97db04d29968fbe (patch) | |
tree | 94d34ff277c71ec509f10469dae609cdd57af179 /drivers | |
parent | drm/amdgpu: fix array out of bounds (diff) | |
download | linux-a7aabcc8a5f5e7834abb538ad97db04d29968fbe.tar.xz linux-a7aabcc8a5f5e7834abb538ad97db04d29968fbe.zip |
drm/amd/powerplay: use ARRAY_SIZE() to calculate array size.
It is preferred to use ARRAY_SIZE() for size calculation, instead
using sizeof(array)/sizeof(*array). It makes the code more readable.
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c index da18f44fd1c8..87c023e518ab 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c @@ -639,7 +639,7 @@ static int cz_smu_populate_firmware_entries(struct pp_smumgr *smumgr) cz_smu->driver_buffer_length = 0; - for (i = 0; i < sizeof(firmware_list)/sizeof(*firmware_list); i++) { + for (i = 0; i < ARRAY_SIZE(firmware_list); i++) { firmware_type = cz_translate_firmware_enum_to_arg(smumgr, firmware_list[i]); |