]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
platform/x86: fujitsu-laptop: make hotkey handling functions more similar
authorMichał Kępień <kernel@kempniu.pl>
Wed, 11 Jan 2017 08:59:33 +0000 (09:59 +0100)
committerDarren Hart <dvhart@linux.intel.com>
Sat, 4 Feb 2017 01:47:19 +0000 (02:47 +0100)
Make two minor tweaks to acpi_fujitsu_hotkey_press() to make it more
similar to acpi_fujitsu_hotkey_release():

  * call vdbg_printk() after reporting the input event,
  * return immediately when kfifo_in_locked() fails.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/fujitsu-laptop.c

index 1e54dddf51defcf2168a293df19b06dbea933eb3..2b218b1d13e55dc985a2ca27e44b6a6ddf905141 100644 (file)
@@ -1040,18 +1040,18 @@ static void acpi_fujitsu_hotkey_press(int keycode)
        struct input_dev *input = fujitsu_hotkey->input;
        int status;
 
-       vdbg_printk(FUJLAPTOP_DBG_TRACE,
-                   "Push keycode into ringbuffer [%d]\n", keycode);
        status = kfifo_in_locked(&fujitsu_hotkey->fifo,
                                 (unsigned char *)&keycode, sizeof(keycode),
                                 &fujitsu_hotkey->fifo_lock);
        if (status != sizeof(keycode)) {
                vdbg_printk(FUJLAPTOP_DBG_WARN,
                            "Could not push keycode [0x%x]\n", keycode);
-       } else {
-               input_report_key(input, keycode, 1);
-               input_sync(input);
+               return;
        }
+       input_report_key(input, keycode, 1);
+       input_sync(input);
+       vdbg_printk(FUJLAPTOP_DBG_TRACE,
+                   "Push keycode into ringbuffer [%d]\n", keycode);
 }
 
 static void acpi_fujitsu_hotkey_release(void)