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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h-NCAst+pQre2kVeidE7t4N5PM2UU46LbYPsdmKDRAoQ@mail.gmail.com>
Date:   Fri, 13 Oct 2023 19:35:02 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Michal Wilczynski <michal.wilczynski@...el.com>
Cc:     linux-acpi@...r.kernel.org, rafael@...nel.org,
        dan.j.williams@...el.com, vishal.l.verma@...el.com,
        lenb@...nel.org, dave.jiang@...el.com, ira.weiny@...el.com,
        rui.zhang@...el.com, linux-kernel@...r.kernel.org,
        nvdimm@...ts.linux.dev, Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v3 2/6] ACPI: AC: Use string_choices API instead of
 ternary operator

On Wed, Oct 11, 2023 at 10:34 AM Michal Wilczynski
<michal.wilczynski@...el.com> wrote:
>
> Use modern string_choices API instead of manually determining the
> output using ternary operator.
>
> Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Signed-off-by: Michal Wilczynski <michal.wilczynski@...el.com>
> ---
>  drivers/acpi/ac.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
> index 83d45c681121..f809f6889b4a 100644
> --- a/drivers/acpi/ac.c
> +++ b/drivers/acpi/ac.c
> @@ -17,6 +17,7 @@
>  #include <linux/delay.h>
>  #include <linux/platform_device.h>
>  #include <linux/power_supply.h>
> +#include <linux/string_choices.h>
>  #include <linux/acpi.h>
>  #include <acpi/battery.h>
>
> @@ -243,8 +244,8 @@ static int acpi_ac_add(struct acpi_device *device)
>                 goto err_release_ac;
>         }
>
> -       pr_info("%s [%s] (%s)\n", acpi_device_name(device),
> -               acpi_device_bid(device), ac->state ? "on-line" : "off-line");
> +       pr_info("%s [%s] (%s-line)\n", acpi_device_name(device),
> +               acpi_device_bid(device), str_on_off(ac->state));
>
>         ac->battery_nb.notifier_call = acpi_ac_battery_notify;
>         register_acpi_notifier(&ac->battery_nb);
> --

Applied as 6.7 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ