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>
This commit is contained in:
Kaushlendra Kumar 2026-04-02 21:45:32 +05:30 committed by Shuah Khan
parent 8bbd81ddbe
commit 2fd3b83cac
6 changed files with 0 additions and 12 deletions

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;