mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>,
	Alex Hung <alexhung@gmail.com>
Subject: Re: [PATCH v1 1/1] platform/x86: intel-hid: Use string_choices API instead of ternary operator
Date: Wed, 21 Aug 2024 15:32:46 +0300 (EEST)	[thread overview]
Message-ID: <b4dd5422-092a-7f21-0e3e-834a1a77140a@linux.intel.com> (raw)
In-Reply-To: <20240821120458.3702655-1-andriy.shevchenko@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

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@linux.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@linux.intel.com>

-- 
 i.

  reply	other threads:[~2024-08-21 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 12:04 Andy Shevchenko
2024-08-21 12:32 ` Ilpo Järvinen [this message]
2024-08-26 14:49 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4dd5422-092a-7f21-0e3e-834a1a77140a@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=alexhung@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®