]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpupower: remove extern declarations in cmd functions
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Thu, 2 Apr 2026 16:15:32 +0000 (21:45 +0530)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 Apr 2026 17:25:32 +0000 (11:25 -0600)
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>
tools/power/cpupower/utils/cpufreq-info.c
tools/power/cpupower/utils/cpufreq-set.c
tools/power/cpupower/utils/cpuidle-info.c
tools/power/cpupower/utils/cpuidle-set.c
tools/power/cpupower/utils/cpupower-info.c
tools/power/cpupower/utils/cpupower-set.c

index 5fe01e516817e8b8a3dfd6eb6d3a095c909dffea..5a242b491a9d04f1615ba46e2f1a21eec53784c8 100644 (file)
@@ -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;
index c5e60a39cfa619ebf517aa4d51f8e9a6d5d27ce1..06cd4b2801325e41ed49a68783df7d901d6df03a 100644 (file)
@@ -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;
index 81b4763a97d6de87a367f31a3e55f9a059bb916e..ccb37125bd37efa39f6c9bc4d3e04787b65d26e5 100644 (file)
@@ -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;
 
index a551d1d4ac51307355a45dfeea106791eb61c111..703094f1343cee9fa889629618a498b75b18b3a1 100644 (file)
@@ -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;
index 18fd7751f509fd2247a4eb78fecf7d6dae5975f0..79154d71e4982a5353a10f8f9b31635d3e88d63b 100644 (file)
@@ -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;
 
index 550a942e72ce7d833bda04b94b88a913eb1f47e3..c2176b9fa57d4452d3d4e0b5206a30c616c42346 100644 (file)
@@ -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;