cpupower: remove extern declarations in cmd functions
PATCH v2 1/1 cpupower: remove extern declarations in cmd functions
extern char *optarg and extern int optind, opterr, optopt are already declared by <getopt.h>, which is included at the top of the file. Repeating extern declarations inside a function body is misleading and unnecessary.
Signed-off-by Kaushlendra Kumar <[email protected]>
---
v2: Extended the fix to all cmd functions across cpupower utils
tools/power/cpupower/utils/cpufreq-info.c | 2 -- tools/power/cpupower/utils/cpufreq-set.c | 2 -- tools/power/cpupower/utils/cpuidle-info.c | 2 -- tools/power/cpupower/utils/cpuidle-set.c | 2 -- tools/power/cpupower/utils/cpupower-info.c | 2 -- tools/power/cpupower/utils/cpupower-set.c | 2 -- 6 files changed, 12 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -542,8 +542,6 @@ static struct option info_opts[] = {int cmd_freq_info (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;int ret =0 , cont =1 ;unsigned int cpu =0 ;unsigned int human =0 ;
tools/power/cpupower/utils/cpufreq-set.c +0 -2
@@ -195,8 +195,6 @@ static int do_one_cpu(unsigned int cpu, struct cpufreq_policy *new_pol,int cmd_freq_set (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;int ret =0 , cont =1 ;int double_parm =0 , related =0 , policychange =0 ;unsigned long freq =0 ;
tools/power/cpupower/utils/cpuidle-info.c +0 -2
@@ -139,8 +139,6 @@ static inline void cpuidle_exit(int fail)int cmd_idle_info (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;int ret =0 , cont =1 , output_param =0 , verbose =1 ;unsigned int cpu =0 ;
tools/power/cpupower/utils/cpuidle-set.c +0 -2
@@ -24,8 +24,6 @@ static struct option info_opts[] = {int cmd_idle_set (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;int ret =0 , cont =1 , param =0 , disabled;unsigned long long latency =0 , state_latency;unsigned int cpu =0 , idlestate =0 , idlestates =0 ;
tools/power/cpupower/utils/cpupower-info.c +0 -2
@@ -28,8 +28,6 @@ static void print_wrong_arg_exit(void)int cmd_info (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;unsigned int cpu;struct utsname uts;
tools/power/cpupower/utils/cpupower-set.c +0 -2
@@ -33,8 +33,6 @@ static void print_wrong_arg_exit(void)int cmd_set (int argc,char **argv) { -extern char *optarg; -extern int optind, opterr, optopt;unsigned int cpu;struct utsname uts;
Signature · 1 line
2.34.1