From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Andy Shevchenko <andy@kernel.org>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Vishnu Sankar <vishnuocv@gmail.com>,
Nitin Joshi <njoshi1@lenovo.com>,
ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 03/24] platform/x86: thinkpad_acpi: Drop setting send_/ignore_acpi_ev defaults twice
Date: Mon, 22 Apr 2024 11:07:45 +0300 (EEST) [thread overview]
Message-ID: <4f62150d-da65-7ecf-fc5d-50afa5dfccb3@linux.intel.com> (raw)
In-Reply-To: <20240421154520.37089-4-hdegoede@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3765 bytes --]
On Sun, 21 Apr 2024, Hans de Goede wrote:
> send_acpi_ev, ignore_acpi_ev are already initialized to true resp. false by
Wording here is odd (but I'm not native so could be I just don't
understand what "true resp. false" is supposed to mean/fit into the
general structure of this sentence). I could nonetheless guess the
general meaning of the sentence despite that, but you might want to
consider rewording it into something that is easier to understand.
The code change is fine,
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> hotkey_notify() before calling the various helpers. Drop the needless
> re-initialization from the helpers.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 24 +++++-------------------
> 1 file changed, 5 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index fc5681808c3b..007223fded30 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -3754,14 +3754,12 @@ static bool hotkey_notify_extended_hotkey(const u32 hkey)
> return false;
> }
>
> +/* 0x1000-0x1FFF: key presses */
> static bool hotkey_notify_hotkey(const u32 hkey,
> bool *send_acpi_ev,
> bool *ignore_acpi_ev)
> {
> - /* 0x1000-0x1FFF: key presses */
> unsigned int scancode = hkey & 0xfff;
> - *send_acpi_ev = true;
> - *ignore_acpi_ev = false;
>
> /*
> * Original events are in the 0x10XX range, the adaptive keyboard
> @@ -3794,14 +3792,11 @@ static bool hotkey_notify_hotkey(const u32 hkey,
> return false;
> }
>
> +/* 0x2000-0x2FFF: Wakeup reason */
> static bool hotkey_notify_wakeup(const u32 hkey,
> bool *send_acpi_ev,
> bool *ignore_acpi_ev)
> {
> - /* 0x2000-0x2FFF: Wakeup reason */
> - *send_acpi_ev = true;
> - *ignore_acpi_ev = false;
> -
> switch (hkey) {
> case TP_HKEY_EV_WKUP_S3_UNDOCK: /* suspend, undock */
> case TP_HKEY_EV_WKUP_S4_UNDOCK: /* hibernation, undock */
> @@ -3834,14 +3829,11 @@ static bool hotkey_notify_wakeup(const u32 hkey,
> return true;
> }
>
> +/* 0x4000-0x4FFF: dock-related events */
> static bool hotkey_notify_dockevent(const u32 hkey,
> bool *send_acpi_ev,
> bool *ignore_acpi_ev)
> {
> - /* 0x4000-0x4FFF: dock-related events */
> - *send_acpi_ev = true;
> - *ignore_acpi_ev = false;
> -
> switch (hkey) {
> case TP_HKEY_EV_UNDOCK_ACK:
> /* ACPI undock operation completed after wakeup */
> @@ -3879,14 +3871,11 @@ static bool hotkey_notify_dockevent(const u32 hkey,
> }
> }
>
> +/* 0x5000-0x5FFF: human interface helpers */
> static bool hotkey_notify_usrevent(const u32 hkey,
> bool *send_acpi_ev,
> bool *ignore_acpi_ev)
> {
> - /* 0x5000-0x5FFF: human interface helpers */
> - *send_acpi_ev = true;
> - *ignore_acpi_ev = false;
> -
> switch (hkey) {
> case TP_HKEY_EV_PEN_INSERTED: /* X61t: tablet pen inserted into bay */
> case TP_HKEY_EV_PEN_REMOVED: /* X61t: tablet pen removed from bay */
> @@ -3914,14 +3903,11 @@ static bool hotkey_notify_usrevent(const u32 hkey,
> static void thermal_dump_all_sensors(void);
> static void palmsensor_refresh(void);
>
> +/* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */
> static bool hotkey_notify_6xxx(const u32 hkey,
> bool *send_acpi_ev,
> bool *ignore_acpi_ev)
> {
> - /* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */
> - *send_acpi_ev = true;
> - *ignore_acpi_ev = false;
> -
> switch (hkey) {
> case TP_HKEY_EV_THM_TABLE_CHANGED:
> pr_debug("EC reports: Thermal Table has changed\n");
>
next prev parent reply other threads:[~2024-04-22 8:07 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-21 15:44 [PATCH 00/24] platform/x86: thinkpad_acpi: Refactor hotkey handling and add support for some new hotkeys Hans de Goede
2024-04-21 15:44 ` [PATCH 01/24] platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit() Hans de Goede
2024-04-21 15:44 ` [PATCH 02/24] platform/x86: thinkpad_acpi: Provide hotkey_poll_stop_sync() dummy Hans de Goede
2024-04-21 15:44 ` [PATCH 03/24] platform/x86: thinkpad_acpi: Drop setting send_/ignore_acpi_ev defaults twice Hans de Goede
2024-04-22 8:07 ` Ilpo Järvinen [this message]
2024-04-22 8:11 ` Andy Shevchenko
2024-04-22 8:24 ` Ilpo Järvinen
2024-04-23 14:00 ` Hans de Goede
2024-04-21 15:45 ` [PATCH 04/24] platform/x86: thinkpad_acpi: Drop ignore_acpi_ev Hans de Goede
2024-04-21 15:45 ` [PATCH 05/24] platform/x86: thinkpad_acpi: Use tpacpi_input_send_key() in adaptive kbd code Hans de Goede
2024-04-22 8:11 ` Ilpo Järvinen
2024-04-21 15:45 ` [PATCH 06/24] platform/x86: thinkpad_acpi: Do hkey to scancode translation later Hans de Goede
2024-04-21 15:45 ` [PATCH 07/24] platform/x86: thinkpad_acpi: Make tpacpi_driver_event() return if it handled the event Hans de Goede
2024-04-21 15:45 ` [PATCH 08/24] platform/x86: thinkpad_acpi: Move adaptive kbd event handling to tpacpi_driver_event() Hans de Goede
2024-04-22 8:29 ` Ilpo Järvinen
2024-04-22 11:35 ` Andy Shevchenko
2024-04-23 14:03 ` Hans de Goede
2024-04-22 19:27 ` Mark Pearson
2024-04-23 8:35 ` Hans de Goede
2024-04-23 12:15 ` Mark Pearson
2024-04-23 13:53 ` Hans de Goede
2024-04-21 15:45 ` [PATCH 09/24] platform/x86: thinkpad_acpi: Move special original hotkeys handling out of switch-case Hans de Goede
2024-04-21 15:45 ` [PATCH 10/24] platform/x86: thinkpad_acpi: Move hotkey_user_mask check to tpacpi_input_send_key() Hans de Goede
2024-04-21 15:45 ` [PATCH 11/24] platform/x86: thinkpad_acpi: Always call tpacpi_driver_event() for hotkeys Hans de Goede
2024-04-21 15:45 ` [PATCH 12/24] platform/x86: thinkpad_acpi: Drop tpacpi_input_send_key_masked() and hotkey_driver_event() Hans de Goede
2024-04-21 15:45 ` [PATCH 13/24] platform/x86: thinkpad_acpi: Move hkey > scancode mapping to tpacpi_input_send_key() Hans de Goede
2024-04-21 15:45 ` [PATCH 14/24] platform/x86: thinkpad_acpi: Move tpacpi_driver_event() call " Hans de Goede
2024-04-21 15:45 ` [PATCH 15/24] platform/x86: thinkpad_acpi: Do not send ACPI netlink events for unknown hotkeys Hans de Goede
2024-04-21 15:45 ` [PATCH 16/24] platform/x86: thinkpad_acpi: Change hotkey_reserved_mask initialization Hans de Goede
2024-04-21 15:45 ` [PATCH 17/24] platform/x86: thinkpad_acpi: Use correct keycodes for volume and brightness keys Hans de Goede
2024-04-21 19:11 ` Andy Shevchenko
2024-04-23 14:06 ` Hans de Goede
2024-04-21 15:45 ` [PATCH 18/24] platform/x86: thinkpad_acpi: Drop KEY_RESERVED special handling Hans de Goede
2024-04-21 15:45 ` [PATCH 19/24] platform/x86: thinkpad_acpi: Switch to using sparse-keymap helpers Hans de Goede
2024-04-21 15:45 ` [PATCH 20/24] platform/x86: thinkpad_acpi: Add mappings for adaptive kbd clipping-tool and cloud keys Hans de Goede
2024-04-21 15:45 ` [PATCH 21/24] platform/x86: thinkpad_acpi: Simplify known_ev handling Hans de Goede
2024-04-21 15:45 ` [PATCH 22/24] platform/x86: thinkpad_acpi: Support for trackpoint doubletap Hans de Goede
2024-04-21 15:45 ` [PATCH 23/24] platform/x86: thinkpad_acpi: Support for system debug info hotkey Hans de Goede
2024-04-21 15:45 ` [PATCH 24/24] platform/x86: thinkpad_acpi: Support hotkey to disable trackpoint doubletap Hans de Goede
2024-04-21 17:17 ` [PATCH 00/24] platform/x86: thinkpad_acpi: Refactor hotkey handling and add support for some new hotkeys Mark Pearson
2024-04-22 0:36 ` [ibm-acpi-devel] " Mark Pearson
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=4f62150d-da65-7ecf-fc5d-50afa5dfccb3@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andy@kernel.org \
--cc=hdegoede@redhat.com \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=mpearson-lenovo@squebb.ca \
--cc=njoshi1@lenovo.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=vishnuocv@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.