The show_regulator_info function does no longer depend no the global variable numregulators.
Signed-off-by: Daniel Lezcano <daniel.lezc...@free.fr> --- display.c | 4 ++-- powerdebug.c | 3 ++- powerdebug.h | 3 ++- 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); -- 1.7.1 _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev