aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2011-03-26 22:06:00 +0100
committerAmit Kucheria <amit.kucheria@linaro.org>2011-04-04 02:25:18 +0300
commit833b63a65ca488858122ac9a348eab3be52cd439 (patch)
treea10e09d6849bc7264e5721e24e0b0a0c60e7fbcc
parent408580e6f46740a1d4872d9a8f0cb85ba8c1aa75 (diff)
downloadpowerdebug-833b63a65ca488858122ac9a348eab3be52cd439.tar.gz
Pass numregulators paramter to show_regulator_info
The show_regulator_info function does no longer depend no the global variable numregulators. Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r--display.c4
-rw-r--r--powerdebug.c3
-rw-r--r--powerdebug.h3
3 files changed, 6 insertions, 4 deletions
diff --git a/display.c b/display.c
index b439814..fb252cb 100644
--- a/display.c
+++ b/display.c
@@ -176,7 +176,7 @@ void show_header(int selectedwindow)
}
-void show_regulator_info(struct regulator_info *reg_info, int verbose)
+void show_regulator_info(struct regulator_info *reg_info, int nr_reg, int verbose)
{
int i, count = 1;
@@ -194,7 +194,7 @@ void show_regulator_info(struct regulator_info *reg_info, int verbose)
print(regulator_win, 84, 0, "Max u-volts");
wattroff(regulator_win, A_BOLD);
- for (i = 0; i < numregulators; i++) {
+ for (i = 0; i < nr_reg; i++) {
int col = 0;
if ((i + 2) > (maxy-2))
diff --git a/powerdebug.c b/powerdebug.c
index d705bb9..6e9e896 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -266,7 +266,8 @@ int mainloop(struct powerdebug_options *options)
regulator_read_info(regulators_info, numregulators);
if (!options->dump) {
create_selectedwindow(options->selectedwindow);
- show_regulator_info(regulators_info, options->verbose);
+ show_regulator_info(regulators_info, numregulators,
+ options->verbose);
}
else
regulator_print_info(regulators_info, numregulators,
diff --git a/powerdebug.h b/powerdebug.h
index e92049a..3c4f1e8 100644
--- a/powerdebug.h
+++ b/powerdebug.h
@@ -58,4 +58,5 @@ 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);
+extern void show_regulator_info(struct regulator_info *reg_info,
+ int nr_reg, int verbose);