cpufreq: amd-pstate: set varaiable mode_state_machine storage-class-specifier to static
Subsystems (2)
PATCH 1/1 cpufreq: amd-pstate: set varaiable mode_state_machine storage-class-specifier to static
smatch reportsdrivers/cpufreq/amd-pstate.c:907:25: warning: symbol
'mode_state_machine' was not declared. Should it be static?
This variable is only used in one file so it should be static.
--- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/amd-pstate.c +1 -1
@@ -904,7 +904,7 @@ static int amd_pstate_change_driver_mode(int mode)return 0 ; } -cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { +static cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { [AMD_PSTATE_DISABLE ] = { [AMD_PSTATE_DISABLE ] =NULL , [AMD_PSTATE_PASSIVE ] = amd_pstate_register_driver,
Signature · 1 line
2.27.0
Quoted 7 lines · Tom Rix
smatch reports
drivers/cpufreq/amd-pstate.c:907:25: warning: symbol
'mode_state_machine' was not declared. Should it be static?This variable is only used in one file so it should be static.
Signed-off-by Tom Rix <[email protected]>
Quoted 20 lines
--- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/amd-pstate.c +1
-1@@ -904,7 +904,7 @@ static int amd_pstate_change_driver_mode(int mode)return 0 ; } -cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { +static cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { [AMD_PSTATE_DISABLE ] = { [AMD_PSTATE_DISABLE ] =NULL , [AMD_PSTATE_PASSIVE ] = amd_pstate_register_driver,Signature · 1 line
2.27.0
Quoted 8 lines · Tom Rix
smatch reports
drivers/cpufreq/amd-pstate.c:907:25: warning: symbol
'mode_state_machine' was not declared. Should it be static?This variable is only used in one file so it should be static.
Signed-off-by Tom Rix <[email protected]>---
You might want to use the Fixes: commit ("")
tag? It will help people to pick the patch while
back-porting fixes to older kernels.'
For example:
https://lore.kernel.org/all/[email protected]/
Otherwise,
Quoted 16 lines
drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/amd-pstate.c +1
-1@@ -904,7 +904,7 @@ static int amd_pstate_change_driver_mode(int mode)return 0 ; } -cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { +static cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { [AMD_PSTATE_DISABLE ] = { [AMD_PSTATE_DISABLE ] =NULL , [AMD_PSTATE_PASSIVE ] = amd_pstate_register_driver,
Signature · 2 lines
Thanks and Regards, Dhruva Gole
Quoted 17 lines · Tom Rix
smatch reports
drivers/cpufreq/amd-pstate.c:907:25: warning: symbol
'mode_state_machine' was not declared. Should it be static?This variable is only used in one file so it should be static.
Signed-off-by Tom Rix <[email protected]>--- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/amd-pstate.c +0
-0
drivers/cpufreq/amd-pstate.c static int amd_pstate_change_driver_mode(int mode)
Quoted 9 lines
drivers/cpufreq/amd-pstate.c +1
-2@@ -904,7 +904,7 @@ static int amd_pstate_change_driver_mode(int mode)return 0 ; } -cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { +static cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX ][AMD_PSTATE_MAX ] = { [AMD_PSTATE_DISABLE ] = { [AMD_PSTATE_DISABLE ] =NULL , [AMD_PSTATE_PASSIVE ] = amd_pstate_register_driver, --
Applied as 6.4 material (under edited subject), thanks!