* [PATCH] platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles
@ 2023-06-06 15:18 Mark Pearson
2023-06-13 10:26 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Mark Pearson @ 2023-06-06 15:18 UTC (permalink / raw)
To: mpearson-lenovo
Cc: hdegoede, platform-driver-x86, linux-kernel, dan.carpenter,
mario.limonciello, lkp, oe-kbuild-all, Dan Carpenter
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: 1bc5d819f0b9 ("platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms")
Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
drivers/platform/x86/thinkpad_acpi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index b3808ad77278..4b89f42de723 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -10524,7 +10524,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
static void dytc_profile_refresh(void)
{
enum platform_profile_option profile;
- int output, err = 0;
+ int output = 0, err = 0;
int perfmode, funcmode;
mutex_lock(&dytc_mutex);
@@ -10538,6 +10538,8 @@ static void dytc_profile_refresh(void)
err = dytc_command(DYTC_CMD_GET, &output);
/* Check if we are PSC mode, or have AMT enabled */
funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF;
+ } else { /* Unknown profile mode */
+ err = -ENODEV;
}
mutex_unlock(&dytc_mutex);
if (err)
--
2.40.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles
2023-06-06 15:18 [PATCH] platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles Mark Pearson
@ 2023-06-13 10:26 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-06-13 10:26 UTC (permalink / raw)
To: Mark Pearson
Cc: platform-driver-x86, linux-kernel, dan.carpenter,
mario.limonciello, lkp, oe-kbuild-all, Dan Carpenter
Hi,
On 6/6/23 17:18, Mark Pearson wrote:
> 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: 1bc5d819f0b9 ("platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms")
> Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/x86/thinkpad_acpi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index b3808ad77278..4b89f42de723 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -10524,7 +10524,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
> static void dytc_profile_refresh(void)
> {
> enum platform_profile_option profile;
> - int output, err = 0;
> + int output = 0, err = 0;
> int perfmode, funcmode;
>
> mutex_lock(&dytc_mutex);
> @@ -10538,6 +10538,8 @@ static void dytc_profile_refresh(void)
> err = dytc_command(DYTC_CMD_GET, &output);
> /* Check if we are PSC mode, or have AMT enabled */
> funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF;
> + } else { /* Unknown profile mode */
> + err = -ENODEV;
> }
> mutex_unlock(&dytc_mutex);
> if (err)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-13 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06 15:18 [PATCH] platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles Mark Pearson
2023-06-13 10:26 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®