diff mbox series

[-next,1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj'

Message ID 1623318039-57133-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive)
State Awaiting Upstream
Delegated to: Rafael Wysocki
Headers show
Series [-next,1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' | expand

Commit Message

Yang Li June 10, 2021, 9:40 a.m. UTC
'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]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/acpi/processor_throttling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki June 14, 2021, 3:20 p.m. UTC | #1
On Thu, Jun 10, 2021 at 11:40 AM Yang Li <yang.lee@linux.alibaba.com> wrote:
>
> '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]
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/acpi/processor_throttling.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
> index 0086afe..017fd02 100644
> --- a/drivers/acpi/processor_throttling.c
> +++ b/drivers/acpi/processor_throttling.c
> @@ -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!
diff mbox series

Patch

diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 0086afe..017fd02 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -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);