diff mbox series

[v2,1/4] platform/x86: thinkpad_acpi: simplify known_ev handling

Message ID 20240417173124.9953-1-mpearson-lenovo@squebb.ca (mailing list archive)
State Superseded, archived
Headers show
Series [v2,1/4] platform/x86: thinkpad_acpi: simplify known_ev handling | expand

Commit Message

Mark Pearson April 17, 2024, 5:31 p.m. UTC
Modify how known_ev event is handled in preparation for adding new keycode
range.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
Changes in v2: 
 - New addition to series based on recommendations from review.
 - Note previous input patch was dropped so in numbering gets replaced by this.

 drivers/platform/x86/thinkpad_acpi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 82429e59999d..3b48d893280f 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -4026,6 +4026,7 @@  static void hotkey_notify(struct ibm_struct *ibm, u32 event)
 
 		send_acpi_ev = true;
 		ignore_acpi_ev = false;
+		known_ev = false;
 
 		switch (hkey >> 12) {
 		case 1:
@@ -4051,8 +4052,6 @@  static void hotkey_notify(struct ibm_struct *ibm, u32 event)
 				/* FIXME: kick libata if SATA link offline */
 				known_ev = true;
 				break;
-			default:
-				known_ev = false;
 			}
 			break;
 		case 4:
@@ -4078,11 +4077,8 @@  static void hotkey_notify(struct ibm_struct *ibm, u32 event)
 				tpacpi_send_radiosw_update();
 				send_acpi_ev = 0;
 				known_ev = true;
-				break;
 			}
-			fallthrough;	/* to default */
-		default:
-			known_ev = false;
+			break;
 		}
 		if (!known_ev) {
 			pr_notice("unhandled HKEY event 0x%04x\n", hkey);