drm/amd/ras: omit redundant memset of already-zeroed buffers
Subsystems (2)
PATCH 1/1 drm/amd/ras: omit redundant memset of already-zeroed buffers
Both of these are allocated with kzalloc() right before memset(), so the buffer is already zeroed and the memset() is redundant.
Signed-off-by Tobias Klauser <[email protected]>
--- drivers/gpu/drm/amd/ras/core/eeprom.c | 1 - drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 2 -- 2 files changed, 3 deletions(-)
drivers/gpu/drm/amd/ras/core/eeprom.c +0 -1
@@ -1091,7 +1091,6 @@ static int ras_eeprom_sw_init(struct ras_core_context *ras_core,return -ENOMEM ; mgr->ras_eeprom = control; -memset (control,0 ,sizeof (*control)); control->mgr = mgr; control->max_read_len = param->max_i2c_read_len;
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +0 -2
@@ -298,8 +298,6 @@ static int amdgpu_virt_ras_get_cper_records(struct ras_core_context *ras_core,return RAS_CMD__ERROR_GENERIC ; } -memset (out_buf,0 , req->buf_size); -for (i =0 ; i < req->cper_num; i++) { batch_id = req->cper_start_id + i;if (batch_id >= overview->last_batch_id)
Signature · 1 line
2.55.0
Quoted 5 lines · Tobias Klauser
Both of these are allocated with
kzalloc()right beforememset(), so the buffer is already zeroed and thememset()is redundant.Signed-off-by Tobias Klauser <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
and applied.
Alex
Quoted 33 lines
--- drivers/gpu/drm/amd/ras/core/eeprom.c | 1 - drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 2 -- 2 files changed, 3 deletions(-)drivers/gpu/drm/amd/ras/core/eeprom.c +0
-1@@ -1091,7 +1091,6 @@ static int ras_eeprom_sw_init(struct ras_core_context *ras_core,return -ENOMEM ; mgr->ras_eeprom = control; -memset (control,0 ,sizeof (*control)); control->mgr = mgr; control->max_read_len = param->max_i2c_read_len;drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +0
-3@@ -298,8 +298,6 @@ static int amdgpu_virt_ras_get_cper_records(struct ras_core_context *ras_core,return RAS_CMD__ERROR_GENERIC ; } -memset (out_buf,0 , req->buf_size); -for (i =0 ; i < req->cper_num; i++) { batch_id = req->cper_start_id + i;if (batch_id >= overview->last_batch_id) --2.55.0