]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: Use ARRAY_SIZE for sos_old_versions
authorzhengbin <zhengbin13@huawei.com>
Fri, 22 Nov 2019 03:42:52 +0000 (11:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 22 Nov 2019 19:27:11 +0000 (14:27 -0500)
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/psp_v3_1.c:182:40-41: WARNING: Use ARRAY_SIZE

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c

index b4d6427aaa79f35476fb38b5bc1668aa22ebb87b..735c43c7daab921e283f8bcf7aedcde5c8cae386 100644 (file)
@@ -179,7 +179,7 @@ static bool psp_v3_1_match_version(struct amdgpu_device *adev, uint32_t ver)
         * Double check if the latest four legacy versions.
         * If yes, it is still the right version.
         */
-       for (i = 0; i < sizeof(sos_old_versions) / sizeof(uint32_t); i++) {
+       for (i = 0; i < ARRAY_SIZE(sos_old_versions); i++) {
                if (sos_old_versions[i] == adev->psp.sos_fw_version)
                        return true;
        }