]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: simplify return statement in amdgpu_ras_eeprom_init
authorDheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Thu, 12 Dec 2024 10:56:24 +0000 (16:26 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Dec 2024 17:16:05 +0000 (12:16 -0500)
Remove the logically dead code in the last return statement of
amdgpu_ras_eeprom_init. The condition res < 0 is redundant since
res is already checked for a negative value earlier. Replace
return res < 0 ? res : 0; with return 0 to improve clarity.

Fixes: 63d4c081a556 ("drm/amdgpu: Optimize EEPROM RAS table I/O")
Closes: https://scan7.scan.coverity.com/#/project-view/52337/11354?selectedIssue=1602413
Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

index 0d824f016916c702244d683a7910cd4be0bd3123..52c16bfeccaad88330489283d2c7792e902554aa 100644 (file)
@@ -1390,7 +1390,7 @@ int amdgpu_ras_eeprom_init(struct amdgpu_ras_eeprom_control *control)
        }
        control->ras_fri = RAS_OFFSET_TO_INDEX(control, hdr->first_rec_offset);
 
-       return res < 0 ? res : 0;
+       return 0;
 }
 
 int amdgpu_ras_eeprom_check(struct amdgpu_ras_eeprom_control *control)