]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: lenovo: silence unreachable code warning
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 6 Feb 2025 08:20:35 +0000 (11:20 +0300)
committerJiri Kosina <jkosina@suse.com>
Tue, 4 Mar 2025 20:14:36 +0000 (21:14 +0100)
In theory, this code used to return 0 if CONFIG_ACPI_PLATFORM_PROFILE was
disabled.  It's not clear if that was a config which would actually boot
so we've removed the CONFIG_ACPI_PLATFORM_PROFILE ifdef.  But now the
"return 0;" statement is unreachable and static checker tools complain.

Delete it and pull the else statement in a tab to silence the checker
warning and make the code a bit more clear.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-lenovo.c

index 04508c36bdc8230d6050827fee211278e4d89f27..af29ba840522f99bc2f426d4753f70d442cef3af 100644 (file)
@@ -728,11 +728,9 @@ static int lenovo_raw_event_TP_X12_tab(struct hid_device *hdev, u32 raw_data)
                        if (hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB) {
                                report_key_event(input, KEY_RFKILL);
                                return 1;
-                       } else {
-                               platform_profile_cycle();
-                               return 1;
                        }
-                       return 0;
+                       platform_profile_cycle();
+                       return 1;
                case TP_X12_RAW_HOTKEY_FN_F10:
                        /* TAB1 has PICKUP Phone and TAB2 use Snipping tool*/
                        (hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB) ?