mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 17:03:47 -04:00
drm/amdgpu: remove is_mca_add for ras_add_bad_pages
Remove unnecessary variable and simplify the logic. Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -2802,23 +2802,16 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
|
||||
struct ras_err_handler_data *data;
|
||||
struct ras_err_data err_data;
|
||||
struct eeprom_table_record *err_rec;
|
||||
struct amdgpu_ras_eeprom_control *control =
|
||||
&adev->psp.ras_context.ras->eeprom_control;
|
||||
enum amdgpu_memory_partition nps = AMDGPU_NPS1_PARTITION_MODE;
|
||||
int ret = 0;
|
||||
uint32_t i, j, loop_cnt = 1;
|
||||
bool is_mca_add = true, find_pages_per_pa = false;
|
||||
bool find_pages_per_pa = false;
|
||||
|
||||
if (!con || !con->eh_data || !bps || pages <= 0)
|
||||
return 0;
|
||||
|
||||
if (!adev->umc.ras || !adev->umc.ras->convert_ras_err_addr) {
|
||||
is_mca_add = false;
|
||||
} else {
|
||||
if ((pages > 1) &&
|
||||
(bps[0].address == bps[1].address) &&
|
||||
(bps[0].mem_channel == bps[1].mem_channel))
|
||||
is_mca_add = false;
|
||||
}
|
||||
|
||||
if (from_rom) {
|
||||
err_data.err_addr =
|
||||
kcalloc(adev->umc.retire_unit,
|
||||
@@ -2841,7 +2834,8 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
|
||||
goto free;
|
||||
|
||||
for (i = 0; i < pages; i++) {
|
||||
if (is_mca_add) {
|
||||
if (from_rom &&
|
||||
control->rec_type == AMDGPU_RAS_EEPROM_REC_MCA) {
|
||||
if (!find_pages_per_pa) {
|
||||
if (amdgpu_ras_mca2pa_by_idx(adev, &bps[i], &err_data)) {
|
||||
if (!i && nps == AMDGPU_NPS1_PARTITION_MODE) {
|
||||
|
||||
Reference in New Issue
Block a user