drm/amd/powerplay: Use ARRAY_SIZE for smu7_profiling
authorzhengbin <zhengbin13@huawei.com>
Fri, 22 Nov 2019 03:42:51 +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/powerplay/hwmgr/smu7_hwmgr.c:4946:28-29: 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/powerplay/hwmgr/smu7_hwmgr.c

index f754fbd70f687b27e74b433584cb28dc16628d8c..c3f586613c002a40a96cad2dd5c29c7ba64237ea 100644 (file)
@@ -4943,7 +4943,7 @@ static int smu7_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf)
                        title[0], title[1], title[2], title[3],
                        title[4], title[5], title[6], title[7]);
 
-       len = sizeof(smu7_profiling) / sizeof(struct profile_mode_setting);
+       len = ARRAY_SIZE(smu7_profiling);
 
        for (i = 0; i < len; i++) {
                if (i == hwmgr->power_profile_mode) {