lkml.org 
[lkml]   [2016]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] drm/amd/powerplay: use ARRAY_SIZE() to calculate array size.
From
Date
Am 13.05.2016 um 19:36 schrieb Muhammad Falak R Wani:
> It is preferred to use ARRAY_SIZE() for size calculation, instead
> using sizeof(array)/sizeof(*array). It makes the code more readable.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Thanks for the cleanup,
Christian.

> ---
> drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> index da18f44..87c023e 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]);

\
 
 \ /
  Last update: 2016-05-14 22:21    [W:0.154 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site