Skip to contentSkip to conversation

ACPI: processor_throttling: Remove redundant initialization of 'obj'

PATCH Applied Yang Li 2 participants 3 messages Jun 10, 2021 – Jun 14, 2021 ACPI

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/2 ACPI: processor_throttling: Remove redundant initialization of 'obj'

'obj' is being initialized, however this value is never read as 'obj' is assigned an updated value later. Remove the redundant initialization.

Clean up clang warning:
drivers/acpi/processor_throttling.c:409:20: warning: Value stored to 'obj' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

---
 drivers/acpi/processor_throttling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/processor_throttling.c +1 -1
index 0086afe..017fd02 100644
@@ -406,7 +406,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
 	acpi_status status = 0;
 	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *ptc = NULL;
-	union acpi_object obj = { 0 };
+	union acpi_object obj;
 	struct acpi_processor_throttling *throttling;
 
 	status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 2/2 ACPI: sleep: Fix kernel-doc

Fix function name in sleep.c kernel-doc comment to remove a warning found by running make W=1 LLVM=1.

drivers/acpi/sleep.c:413: warning: expecting prototype for acpi_pre_suspend(). Prototype was for acpi_pm_pre_suspend() instead.

---
 drivers/acpi/sleep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +1 -1
index aaea10d..3023224 100644
@@ -407,7 +407,7 @@ static int acpi_pm_freeze(void)
 }
 
 /**
- * acpi_pre_suspend - Enable wakeup devices, "freeze" EC and save NVS.
+ * acpi_pm_pre_suspend - Enable wakeup devices, "freeze" EC and save NVS.
  */
 static int acpi_pm_pre_suspend(void)
 {
Signature · 1 line
1.8.3.1
maintainer Applied
#2 lore raw
In reply to Yang Li
Quoted 21 lines · Yang Li

'obj' is being initialized, however this value is never read as 'obj' is assigned an updated value later. Remove the redundant initialization.

Clean up clang warning:
drivers/acpi/processor_throttling.c:409:20: warning: Value stored to 'obj' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

---
 drivers/acpi/processor_throttling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/processor_throttling.c +0 -0
index 0086afe..017fd02 100644

drivers/acpi/processor_throttling.c static int acpi_processor_get_throttling_control(struct acpi_processor *pr)

Quoted 9 lines
drivers/acpi/processor_throttling.c +1 -2
@@ -406,7 +406,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
        acpi_status status = 0;
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *ptc = NULL;
-       union acpi_object obj = { 0 };
+       union acpi_object obj;
        struct acpi_processor_throttling *throttling;
 
        status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
--

Applied as 5.14 material, thanks!