Skip to content

Commit 4e06e8b

Browse files
mrhpearsongregkh
authored andcommitted
platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles
[ Upstream commit f999e23 ] Fix issues identified in dytc_profile_refresh identified by lkp-tests. drivers/platform/x86/thinkpad_acpi.c:10538 dytc_profile_refresh() error: uninitialized symbol 'funcmode'. drivers/platform/x86/thinkpad_acpi.c:10531 dytc_profile_refresh() error: uninitialized symbol 'output'. drivers/platform/x86/thinkpad_acpi.c:10537 dytc_profile_refresh() error: uninitialized symbol 'output'. These issues should not lead to real problems in the field as the refresh function should only be called if MMC or PSC mode enabled. But good to fix. Thanks to Dan Carpenter and the lkp-tests project for flagging these. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202306011202.1hbgLRD4-lkp@intel.com/ Fixes: 1bc5d81 ("platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms") Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca> Link: https://lore.kernel.org/r/20230606151804.8819-1-mpearson-lenovo@squebb.ca Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4309bd9 commit 4e06e8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10528,8 +10528,8 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
1052810528
static void dytc_profile_refresh(void)
1052910529
{
1053010530
enum platform_profile_option profile;
10531-
int output, err = 0;
10532-
int perfmode, funcmode;
10531+
int output = 0, err = 0;
10532+
int perfmode, funcmode = 0;
1053310533

1053410534
mutex_lock(&dytc_mutex);
1053510535
if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
@@ -10542,6 +10542,8 @@ static void dytc_profile_refresh(void)
1054210542
err = dytc_command(DYTC_CMD_GET, &output);
1054310543
/* Check if we are PSC mode, or have AMT enabled */
1054410544
funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF;
10545+
} else { /* Unknown profile mode */
10546+
err = -ENODEV;
1054510547
}
1054610548
mutex_unlock(&dytc_mutex);
1054710549
if (err)

0 commit comments

Comments
 (0)