lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iVwXLBZJx3xcgqO6mWEz9ho3MgcCE71mxy8z=RT3HU6w@mail.gmail.com>
Date: Fri, 2 Aug 2024 16:23:50 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] ACPI: battery: Remove redundant NULL initalizations

On Wed, Jul 31, 2024 at 11:54 AM Ilpo Järvinen
<ilpo.jarvinen@...ux.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@...ux.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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ