summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/amd-pstate-ut.c
diff options
context:
space:
mode:
authorMeng Li <li.meng@amd.com>2022-09-06 04:48:26 +0200
committerShuah Khan <skhan@linuxfoundation.org>2022-10-05 19:05:18 +0200
commitce29a148f34fe93601dab835ec25ada1d95aac02 (patch)
tree7b63e1ce2fa055148b7404b38e7a24185adeb290 /drivers/cpufreq/amd-pstate-ut.c
parentDocumentation: amd-pstate: Add unit test introduction (diff)
downloadlinux-ce29a148f34fe93601dab835ec25ada1d95aac02.tar.xz
linux-ce29a148f34fe93601dab835ec25ada1d95aac02.zip
cpufreq: amd-pstate: modify type in argument 2 for filp_open
Modify restricted FMODE_PREAD to experted int O_RDONLY to fix the sparse warnings below: sparse warnings: (new ones prefixed by >>) >> drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: sparse: incorrect type >> in argument 2 (different base types) @@ expected int @@ got >> restricted fmode_t [usertype] @@ drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: expected int drivers/cpufreq/amd-pstate-ut.c:74:40: sparse: got restricted fmode_t [usertype] Signed-off-by: Meng Li <li.meng@amd.com> Reported-by: kernel test robot <lkp@intel.com> Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'drivers/cpufreq/amd-pstate-ut.c')
-rw-r--r--drivers/cpufreq/amd-pstate-ut.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
index 3947b7138184..e4a5b4d90f83 100644
--- a/drivers/cpufreq/amd-pstate-ut.c
+++ b/drivers/cpufreq/amd-pstate-ut.c
@@ -71,7 +71,7 @@ static bool get_shared_mem(void)
ssize_t ret;
if (!boot_cpu_has(X86_FEATURE_CPPC)) {
- filp = filp_open(path, FMODE_PREAD, 0);
+ filp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(filp))
pr_err("%s unable to open %s file!\n", __func__, path);
else {