diff --git a/drivers/gpu/drm/amd/powerplay/inc/fiji_pwrvirus.h b/drivers/gpu/drm/amd/powerplay/inc/fiji_pwrvirus.h index 243de293a3efbb3a5918228e1f1c43849b9b3fdd..e202e567faf4e54c5bf7dab0d2788f4a2c757fa9 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/fiji_pwrvirus.h +++ b/drivers/gpu/drm/amd/powerplay/inc/fiji_pwrvirus.h @@ -35,8 +35,7 @@ struct PWR_Command_Table }; typedef struct PWR_Command_Table PWR_Command_Table; -#define PWR_VIRUS_TABLE_SIZE 10243 -static const PWR_Command_Table PwrVirusTable[PWR_VIRUS_TABLE_SIZE] = +static const PWR_Command_Table PwrVirusTable[] = { { 0x100100b6, mmPCIE_INDEX }, { 0x00000000, mmPCIE_DATA }, diff --git a/drivers/gpu/drm/amd/powerplay/inc/polaris10_pwrvirus.h b/drivers/gpu/drm/amd/powerplay/inc/polaris10_pwrvirus.h index 76039860580ddd613853d8fe4c9449ce012c6a08..8edd3e7860b7dfe659a71e3df61993c1ff631f7f 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/polaris10_pwrvirus.h +++ b/drivers/gpu/drm/amd/powerplay/inc/polaris10_pwrvirus.h @@ -36,10 +36,7 @@ struct PWR_Command_Table { typedef struct PWR_Command_Table PWR_Command_Table; - -#define PWR_VIRUS_TABLE_SIZE 10031 - -static const PWR_Command_Table pwr_virus_table[PWR_VIRUS_TABLE_SIZE] = { +static const PWR_Command_Table pwr_virus_table[] = { { 0x00000000, mmRLC_CNTL }, { 0x00000002, mmRLC_SRM_CNTL }, { 0x15000000, mmCP_ME_CNTL }, diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c index 3820fe8f944afe2f8aa4b579e5913c847fcb0149..289006b8d421240ab53d65f46a7f06731531b5fb 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c @@ -167,7 +167,7 @@ static int fiji_setup_pwr_virus(struct pp_hwmgr *hwmgr) const PWR_Command_Table *pvirus = PwrVirusTable; - for (i = 0; i < PWR_VIRUS_TABLE_SIZE; i++) { + for (i = 0; i < ARRAY_SIZE(PwrVirusTable); i++) { reg = pvirus->reg; data = pvirus->data; if (reg != 0xffffffff) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c index b73b2b445ceeaa2309f56b34ff030df420ddf436..f039320fa794956b58547bc255b569fd2f620c67 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c @@ -68,7 +68,7 @@ static int polaris10_setup_pwr_virus(struct pp_hwmgr *hwmgr) const PWR_Command_Table *pvirus = pwr_virus_table; - for (i = 0; i < PWR_VIRUS_TABLE_SIZE; i++) { + for (i = 0; i < ARRAY_SIZE(pwr_virus_table); i++) { reg = pvirus->reg; data = pvirus->data; if (reg != 0xffffffff) {