drm/amd/display: use ARRAY_SIZE for base60_refresh_rates
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Wed, 9 Jun 2021 10:09:26 +0000 (18:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 10 Jun 2021 15:44:26 +0000 (11:44 -0400)
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an
element.

Clean up the following coccicheck warning:

./drivers/gpu/drm/amd/display/dc/core/dc_resource.c:448:47-48: WARNING:
Use ARRAY_SIZE.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 5fe4c5f80b5406030c1998b006cf883d4bffb464..3feb19f7e11790818e6452994959808cd535e81b 100644 (file)
@@ -445,7 +445,7 @@ bool resource_are_vblanks_synchronizable(
 {
        uint32_t base60_refresh_rates[] = {10, 20, 5};
        uint8_t i;
-       uint8_t rr_count = sizeof(base60_refresh_rates)/sizeof(base60_refresh_rates[0]);
+       uint8_t rr_count = ARRAY_SIZE(base60_refresh_rates);
        uint64_t frame_time_diff;
 
        if (stream1->ctx->dc->config.vblank_alignment_dto_params &&