mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] ACPI: battery: Remove redundant NULL initalizations
@ 2024-07-31  9:53 Ilpo Järvinen
  2024-08-02 14:23 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Ilpo Järvinen @ 2024-07-31  9:53 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel; +Cc: Ilpo Järvinen

A local 'battery' variable is initialized to NULL on two occassions
where it is unconditionally rewritten later. Remove the unnecessary
initializations.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/acpi/battery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index da3a879d638a..06e84d21ba3b 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1207,7 +1207,7 @@ static int acpi_battery_update_retry(struct acpi_battery *battery)
 static int acpi_battery_add(struct acpi_device *device)
 {
 	int result = 0;
-	struct acpi_battery *battery = NULL;
+	struct acpi_battery *battery;
 
 	if (!device)
 		return -EINVAL;
@@ -1260,7 +1260,7 @@ static int acpi_battery_add(struct acpi_device *device)
 
 static void acpi_battery_remove(struct acpi_device *device)
 {
-	struct acpi_battery *battery = NULL;
+	struct acpi_battery *battery;
 
 	if (!device || !acpi_driver_data(device))
 		return;
-- 
2.39.2


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

* Re: [PATCH 1/1] ACPI: battery: Remove redundant NULL initalizations
  2024-07-31  9:53 [PATCH 1/1] ACPI: battery: Remove redundant NULL initalizations Ilpo Järvinen
@ 2024-08-02 14:23 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2024-08-02 14:23 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel

On Wed, Jul 31, 2024 at 11:54 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> A local 'battery' variable is initialized to NULL on two occassions
> where it is unconditionally rewritten later. Remove the unnecessary
> initializations.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  drivers/acpi/battery.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index da3a879d638a..06e84d21ba3b 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -1207,7 +1207,7 @@ static int acpi_battery_update_retry(struct acpi_battery *battery)
>  static int acpi_battery_add(struct acpi_device *device)
>  {
>         int result = 0;
> -       struct acpi_battery *battery = NULL;
> +       struct acpi_battery *battery;
>
>         if (!device)
>                 return -EINVAL;
> @@ -1260,7 +1260,7 @@ static int acpi_battery_add(struct acpi_device *device)
>
>  static void acpi_battery_remove(struct acpi_device *device)
>  {
> -       struct acpi_battery *battery = NULL;
> +       struct acpi_battery *battery;
>
>         if (!device || !acpi_driver_data(device))
>                 return;
> --

Applied as 6.12 material, thanks!

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

end of thread, other threads:[~2024-08-02 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-31  9:53 [PATCH 1/1] ACPI: battery: Remove redundant NULL initalizations Ilpo Järvinen
2024-08-02 14:23 ` 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

all inboxes | Powered by JetHome®