As no function rely on the global variable regulators_info, let's make it static and reduce the scope to powerdebug.c
Signed-off-by: Daniel Lezcano daniel.lezcano@free.fr --- powerdebug.c | 2 ++ powerdebug.h | 4 ++-- regulator.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 15194da..7d91845 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -20,6 +20,8 @@
int highlighted_row;
+static struct regulator_info *regulators_info; + void usage(void) { printf("Usage: powerdebug [OPTIONS]\n"); diff --git a/powerdebug.h b/powerdebug.h index ac2b042..e92049a 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -28,8 +28,6 @@ enum {CLOCK, REGULATOR, SENSOR}; enum {CLOCK_SELECTED = 1, REFRESH_WINDOW};
-extern struct regulator_info *regulators_info; - extern int numregulators;
extern void read_and_dump_clock_info(int verbose); @@ -58,4 +56,6 @@ extern void killall_windows(int all); extern void show_header(int selectedwindow); extern void create_windows(int selectedwindow); extern void create_selectedwindow(int selectedwindow); + +struct regulator_info; extern void show_regulator_info(struct regulator_info *reg_info, int verbose); diff --git a/regulator.h b/regulator.h index 115780e..814691e 100644 --- a/regulator.h +++ b/regulator.h @@ -38,7 +38,7 @@ struct regulator_info { int max_microamps; int requested_microamps; int num_users; -} *regulators_info; +};
extern struct regulator_info *regulator_init(int *nr_regulators); extern int regulator_read_info(struct regulator_info *reg_info);