]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/x86: thinkpad_acpi: Remove unneeded goto
authorEduardo Vasconcelos <eduardo@eduardovasconcelos.com>
Sat, 25 Apr 2026 06:39:34 +0000 (03:39 -0300)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 28 Apr 2026 16:00:43 +0000 (19:00 +0300)
Remove an unneeded goto statement in hotkey_kthread(). Since
the function has a single exit location with no cleanup code,
the jump provides no benefit. Per the kernel coding style,
returning directly is preferred over goto in such case [1].

[1] https://www.kernel.org/doc/html/latest/process/coding-style.html

Signed-off-by: Eduardo Vasconcelos <eduardo@eduardovasconcelos.com>
Tested-by: Eduardo Vasconcelos <eduardo@eduardovasconcelos.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/20260425063936.9360-1-eduardo@eduardovasconcelos.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/lenovo/thinkpad_acpi.c

index e1cee42a1683e93a4fe516e7336b8e8a40a217d7..d4ed6f1216f20a154405307f4a9026cff451f104 100644 (file)
@@ -2469,7 +2469,7 @@ static int hotkey_kthread(void *data)
        bool was_frozen;
 
        if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
-               goto exit;
+               return 0;
 
        set_freezable();
 
@@ -2526,7 +2526,6 @@ static int hotkey_kthread(void *data)
                si ^= 1;
        }
 
-exit:
        return 0;
 }