* [PATCH][next] acpi: power: remove redundant initialization of variable result
@ 2021-05-26 14:12 Colin King
2021-05-26 14:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-05-26 14:12 UTC (permalink / raw
To: Rafael J . Wysocki, Len Brown, linux-acpi; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable result is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/acpi/power.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 97c9a94a1a30..d86865c04f64 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -919,7 +919,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
union acpi_object acpi_object;
struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };
acpi_status status;
- int state, result = -ENODEV;
+ int state, result;
acpi_bus_get_device(handle, &device);
if (device)
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] acpi: power: remove redundant initialization of variable result
2021-05-26 14:12 [PATCH][next] acpi: power: remove redundant initialization of variable result Colin King
@ 2021-05-26 14:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-05-26 14:43 UTC (permalink / raw
To: Colin King
Cc: Rafael J . Wysocki, Len Brown, ACPI Devel Maling List,
kernel-janitors, Linux Kernel Mailing List
On Wed, May 26, 2021 at 4:12 PM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable result is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/acpi/power.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> index 97c9a94a1a30..d86865c04f64 100644
> --- a/drivers/acpi/power.c
> +++ b/drivers/acpi/power.c
> @@ -919,7 +919,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
> union acpi_object acpi_object;
> struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };
> acpi_status status;
> - int state, result = -ENODEV;
> + int state, result;
>
> acpi_bus_get_device(handle, &device);
> if (device)
> --
Equivalent change is made in
https://patchwork.kernel.org/project/linux-acpi/patch/2786380.e9J7NaK4W3@kreacher/
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-26 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-26 14:12 [PATCH][next] acpi: power: remove redundant initialization of variable result Colin King
2021-05-26 14:43 ` 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 read-only IMAP folder(s) and NNTP newsgroup(s).