Skip to content

Commit 2fd3b83

Browse files
kaushlenshuahkh
authored andcommitted
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 <kaushlendra.kumar@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 8bbd81d commit 2fd3b83

6 files changed

Lines changed: 0 additions & 12 deletions

File tree

tools/power/cpupower/utils/cpufreq-info.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,6 @@ static struct option info_opts[] = {
542542

543543
int cmd_freq_info(int argc, char **argv)
544544
{
545-
extern char *optarg;
546-
extern int optind, opterr, optopt;
547545
int ret = 0, cont = 1;
548546
unsigned int cpu = 0;
549547
unsigned int human = 0;

tools/power/cpupower/utils/cpufreq-set.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ static int do_one_cpu(unsigned int cpu, struct cpufreq_policy *new_pol,
195195

196196
int cmd_freq_set(int argc, char **argv)
197197
{
198-
extern char *optarg;
199-
extern int optind, opterr, optopt;
200198
int ret = 0, cont = 1;
201199
int double_parm = 0, related = 0, policychange = 0;
202200
unsigned long freq = 0;

tools/power/cpupower/utils/cpuidle-info.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ static inline void cpuidle_exit(int fail)
139139

140140
int cmd_idle_info(int argc, char **argv)
141141
{
142-
extern char *optarg;
143-
extern int optind, opterr, optopt;
144142
int ret = 0, cont = 1, output_param = 0, verbose = 1;
145143
unsigned int cpu = 0;
146144

tools/power/cpupower/utils/cpuidle-set.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ static struct option info_opts[] = {
2424

2525
int cmd_idle_set(int argc, char **argv)
2626
{
27-
extern char *optarg;
28-
extern int optind, opterr, optopt;
2927
int ret = 0, cont = 1, param = 0, disabled;
3028
unsigned long long latency = 0, state_latency;
3129
unsigned int cpu = 0, idlestate = 0, idlestates = 0;

tools/power/cpupower/utils/cpupower-info.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ static void print_wrong_arg_exit(void)
2828

2929
int cmd_info(int argc, char **argv)
3030
{
31-
extern char *optarg;
32-
extern int optind, opterr, optopt;
3331
unsigned int cpu;
3432
struct utsname uts;
3533

tools/power/cpupower/utils/cpupower-set.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ static void print_wrong_arg_exit(void)
3333

3434
int cmd_set(int argc, char **argv)
3535
{
36-
extern char *optarg;
37-
extern int optind, opterr, optopt;
3836
unsigned int cpu;
3937
struct utsname uts;
4038

0 commit comments

Comments
 (0)