Skip to content

Commit 8d6e5e8

Browse files
SSapkalrafaeljw
authored andcommitted
cpufreq: amd-pstate-ut: Remove module parameter access
In amd-pstate-ut, shared memory-based systems call get_shared_mem() as part of amd_pstate_ut_check_enabled() function. This function was written when CONFIG_X86_AMD_PSTATE was tristate config and amd_pstate can be built as a module. Currently CONFIG_X86_AMD_PSTATE is a boolean config and module parameter shared_mem is removed. But amd-pstate-ut code still accesses this module parameter. Remove those accesses. Fixes: 456ca88 ("cpufreq: amd-pstate: change amd-pstate driver to be built-in type") Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Meng Li <li.meng@amd.com> Reviewed-by: Wyes Karny <wyes.karny@amd.com> Suggested-by: Wyes Karny <wyes.karny@amd.com> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com> [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a436ae9 commit 8d6e5e8

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,9 @@ static struct amd_pstate_ut_struct amd_pstate_ut_cases[] = {
6464
static bool get_shared_mem(void)
6565
{
6666
bool result = false;
67-
char path[] = "/sys/module/amd_pstate/parameters/shared_mem";
68-
char buf[5] = {0};
69-
struct file *filp = NULL;
70-
loff_t pos = 0;
71-
ssize_t ret;
72-
73-
if (!boot_cpu_has(X86_FEATURE_CPPC)) {
74-
filp = filp_open(path, O_RDONLY, 0);
75-
if (IS_ERR(filp))
76-
pr_err("%s unable to open %s file!\n", __func__, path);
77-
else {
78-
ret = kernel_read(filp, &buf, sizeof(buf), &pos);
79-
if (ret < 0)
80-
pr_err("%s read %s file fail ret=%ld!\n",
81-
__func__, path, (long)ret);
82-
filp_close(filp, NULL);
83-
}
8467

85-
if ('Y' == *buf)
86-
result = true;
87-
}
68+
if (!boot_cpu_has(X86_FEATURE_CPPC))
69+
result = true;
8870

8971
return result;
9072
}

0 commit comments

Comments
 (0)