drm/amdgpu: simplify return statement in amdgpu_ras_eeprom_init
Subsystems (2)
PATCH 1/1 drm/amdgpu: simplify return statement in amdgpu_ras_eeprom_init
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")
Signed-off-by Dheeraj Reddy Jonnalagadda <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1 -1
@@ -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)
Signature · 1 line
2.34.1
Alex Deucher
AppliedQuoted 9 lines · Dheeraj Reddy Jonnalagadda
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")Signed-off-by Dheeraj Reddy Jonnalagadda <[email protected]>
Applied. thanks!
I've dropped the fixes tag however since, this is not a bug fix, it's just removing logically dead code.
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1
-2@@ -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) --2.34.1