linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] cpufreq: amd-pstate: modify type in argument 2 for filp_open
@ 2022-09-06  2:48 Meng Li
  2022-09-06  3:19 ` Huang Rui
  0 siblings, 1 reply; 2+ messages in thread
From: Meng Li @ 2022-09-06  2:48 UTC (permalink / raw)
  To: Shuah Khan, Huang Rui, linux-pm
  Cc: Rafael J . Wysocki, Nathan Fontenot, Deepak Sharma, Alex Deucher,
	Mario Limonciello, Jinzhou Su, Perry Yuan, Xiaojian Du,
	Viresh Kumar, Borislav Petkov, linux-kernel, Meng Li,
	kernel test robot

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>
---
 drivers/cpufreq/amd-pstate-ut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] cpufreq: amd-pstate: modify type in argument 2 for filp_open
  2022-09-06  2:48 [Patch] cpufreq: amd-pstate: modify type in argument 2 for filp_open Meng Li
@ 2022-09-06  3:19 ` Huang Rui
  0 siblings, 0 replies; 2+ messages in thread
From: Huang Rui @ 2022-09-06  3:19 UTC (permalink / raw)
  To: Meng, Li (Jassmine)
  Cc: Shuah Khan, linux-pm, Rafael J . Wysocki, Fontenot, Nathan,
	Sharma, Deepak, Deucher, Alexander, Limonciello, Mario, Su,
	Jinzhou (Joe),
	Yuan, Perry, Du, Xiaojian, Viresh Kumar, Borislav Petkov,
	linux-kernel, kernel test robot

On Tue, Sep 06, 2022 at 10:48:26AM +0800, Meng, Li (Jassmine) wrote:
> 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>

> ---
>  drivers/cpufreq/amd-pstate-ut.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 {
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-06  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06  2:48 [Patch] cpufreq: amd-pstate: modify type in argument 2 for filp_open Meng Li
2022-09-06  3:19 ` Huang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).