Skip to contentSkip to conversation

ACPI: Remove redundant clearing of context->ret.pointer from acpi_run_osc()

PATCH Applied Hans de Goede 3 participants 3 messages Jun 9, 2021 – Jun 10, 2021 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: Remove redundant clearing of context->ret.pointer from acpi_run_osc()

context->ret.pointer already gets set to NULL at the beginning of acpi_run_osc() and it only gets assigned a new value in the success path near the end of acpi_run_osc(), so the clearing of context->ret.pointer (when status != AE_OK) at the end of acpi_run_osc() is redundant since it will always already be NULL when status != AE_OK.

---
 drivers/acpi/bus.c | 2 --
 1 file changed, 2 deletions(-)
drivers/acpi/bus.c +0 -2
index a4bd673934c0..ab41185cd2a8 100644
@@ -262,8 +262,6 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context)
 
 out_kfree:
 	kfree(output.pointer);
-	if (status != AE_OK)
-		context->ret.pointer = NULL;
 	return status;
 }
 EXPORT_SYMBOL(acpi_run_osc);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Hans de Goede

context->ret.pointer already gets set to NULL at the beginning of acpi_run_osc() and it only gets assigned a new value in the success path near the end of acpi_run_osc(), so the clearing of context->ret.pointer (when status != AE_OK) at the end of acpi_run_osc() is redundant since it will always already be NULL when status != AE_OK.

maintainer Applied
#2 lore raw
Quoted 9 lines · Mika Westerberg
Quoted 7 lines · Hans de Goede

context->ret.pointer already gets set to NULL at the beginning of acpi_run_osc() and it only gets assigned a new value in the success path near the end of acpi_run_osc(), so the clearing of context->ret.pointer (when status != AE_OK) at the end of acpi_run_osc() is redundant since it will always already be NULL when status != AE_OK.

Quoted 3 lines
Quoted 1 line

Applied as 5.14 material, thanks!