platform/x86: thinkpad_acpi: Fix compiler warning about uninitialized err variable
authorHans de Goede <hdegoede@redhat.com>
Wed, 9 Mar 2022 17:05:31 +0000 (18:05 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 9 Mar 2022 17:17:57 +0000 (18:17 +0100)
err is always set because if we get here then dytc_profile_available
is always one of DYTC_FUNCMODE_MMC or DYTC_FUNCMODE_PSC, but the
compiler cannot now that, so initialize err to 0 to avoid a
compiler warning about err being uninitialized.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220309170532.343384-1-hdegoede@redhat.com
drivers/platform/x86/thinkpad_acpi.c

index cb8f52be8253414a4c7c1985a0ab1f1986b8db90..7016c7fc344057d98a6ff84037c17b4b524c33f1 100644 (file)
@@ -10344,7 +10344,7 @@ unlock:
 static void dytc_profile_refresh(void)
 {
        enum platform_profile_option profile;
-       int output, err;
+       int output, err = 0;
        int perfmode;
 
        mutex_lock(&dytc_mutex);