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: <b4dd5422-092a-7f21-0e3e-834a1a77140a@linux.intel.com>
Date: Wed, 21 Aug 2024 15:32:46 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
cc: Hans de Goede <hdegoede@...hat.com>, platform-driver-x86@...r.kernel.org, 
    LKML <linux-kernel@...r.kernel.org>, Alex Hung <alexhung@...il.com>
Subject: Re: [PATCH v1 1/1] platform/x86: intel-hid: Use string_choices API
 instead of ternary operator

On Wed, 21 Aug 2024, Andy Shevchenko wrote:

> Use modern string_choices API instead of manually determining the
> output using ternary operator.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/platform/x86/intel/hid.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c
> index 10cd65497cc1..445e7a59beb4 100644
> --- a/drivers/platform/x86/intel/hid.c
> +++ b/drivers/platform/x86/intel/hid.c
> @@ -13,6 +13,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
> +#include <linux/string_choices.h>
>  #include <linux/suspend.h>
>  #include "../dual_accel_detect.h"
>  
> @@ -331,10 +332,8 @@ static int intel_hid_set_enable(struct device *device, bool enable)
>  	acpi_handle handle = ACPI_HANDLE(device);
>  
>  	/* Enable|disable features - power button is always enabled */
> -	if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN,
> -				      enable)) {
> -		dev_warn(device, "failed to %sable hotkeys\n",
> -			 enable ? "en" : "dis");
> +	if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN, enable)) {
> +		dev_warn(device, "failed to %s hotkeys\n", str_enable_disable(enable));
>  		return -EIO;
>  	}
>  
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ