cpufreq: amd-pstate: modify type in argument 2 for filp_open
authorMeng Li <li.meng@amd.com>
Tue, 6 Sep 2022 02:48:26 +0000 (10:48 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 5 Oct 2022 17:05:18 +0000 (11:05 -0600)
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>
drivers/cpufreq/amd-pstate-ut.c

index 3947b7138184983006f7c896551d77394e68b651..e4a5b4d90f833c0143382992da4187a23b310e81 100644 (file)
@@ -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 {