linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj'
@ 2021-06-10  9:40 Yang Li
  2021-06-10  9:40 ` [PATCH -next 2/2] ACPI: sleep: Fix kernel-doc Yang Li
  2021-06-14 15:20 ` [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2021-06-10  9:40 UTC (permalink / raw)
  To: rjw
  Cc: lenb, nathan, ndesaulniers, linux-acpi, linux-kernel,
	clang-built-linux, 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]

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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -next 2/2] ACPI: sleep: Fix kernel-doc
  2021-06-10  9:40 [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Yang Li
@ 2021-06-10  9:40 ` Yang Li
  2021-06-14 15:20 ` [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Yang Li @ 2021-06-10  9:40 UTC (permalink / raw)
  To: rjw
  Cc: lenb, nathan, ndesaulniers, linux-acpi, linux-kernel,
	clang-built-linux, Yang Li

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.

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

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index aaea10d..3023224 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -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)
 {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj'
  2021-06-10  9:40 [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Yang Li
  2021-06-10  9:40 ` [PATCH -next 2/2] ACPI: sleep: Fix kernel-doc Yang Li
@ 2021-06-14 15:20 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-06-14 15:20 UTC (permalink / raw)
  To: Yang Li
  Cc: Rafael J. Wysocki, Len Brown, Nathan Chancellor,
	Nick Desaulniers, ACPI Devel Maling List,
	Linux Kernel Mailing List, clang-built-linux

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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-14 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  9:40 [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Yang Li
2021-06-10  9:40 ` [PATCH -next 2/2] ACPI: sleep: Fix kernel-doc Yang Li
2021-06-14 15:20 ` [PATCH -next 1/2] ACPI: processor_throttling: Remove redundant initialization of 'obj' Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).