diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2018-04-12 00:21:16 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2018-04-12 00:21:16 +0800 |
commit | 724dfc257a5d228cf4534e6ede30ce0ff34f1f6f (patch) | |
tree | a53d68b6e866531f2b57da5b1d1262086bfea218 | |
parent | 690b758c02379138e78ee7e5964a42a8972a5535 (diff) | |
download | powerdebug-linaro-p-preview.tar.gz |
Workaround for compiling errors with P Previewlinaro-p-preview
Change-Id: I666e9ff6bb294fcbb85801bee21e6a78b1ede82c
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | .gitreview | 5 | ||||
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | display.c | 8 | ||||
-rw-r--r-- | gpio.c | 5 | ||||
-rw-r--r-- | regulator.c | 10 |
5 files changed, 21 insertions, 11 deletions
diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..65c34bd --- /dev/null +++ b/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=android-review.linaro.org +port=29418 +project=platform/external/powerdebug +defaultbranch=linaro-p-preview @@ -19,6 +19,10 @@ LOCAL_CPPFLAGS += \ -DTERMINFO_PATH=\"/system/etc/terminfo\" \ -DDEFINE_ETHTOOL_CMD \ + +LOCAL_CFLAGS += -Wno-unused-parameter +LOCAL_CFLAGS += -Wno-deprecated-declarations + LOCAL_C_INCLUDES += bionic \ external/ncurses \ external/ncurses/lib \ @@ -84,7 +84,7 @@ static int display_show_header(int win) mvwprintw(header_win, 0, curr_pointer, "PowerDebug %s", VERSION); curr_pointer += 20; - for (i = 0; i < array_size; i++) { + for (i = 0; (unsigned long)i < array_size; i++) { if (win == i) wattron(header_win, A_REVERSE); else @@ -316,7 +316,7 @@ struct find_data { struct find_data *display_find_init(void) { const char *regexp = "^[a-z|0-9|_|-|.]"; - struct find_data *findd; + struct find_data *findd = NULL; const size_t len = 64; regex_t *reg; char *search4; @@ -583,7 +583,7 @@ int display_init(int wdefault) getmaxyx(stdscr, maxy, maxx); - for (i = 0; i < array_size; i++) { + for (i = 0; (unsigned long)i < array_size; i++) { main_win = subwin(stdscr, maxy - 2, maxx, 1, 0); if (!main_win) @@ -627,7 +627,7 @@ int display_register(int win, struct display_ops *ops) { size_t array_size = sizeof(windata) / sizeof(windata[0]); - if (win < 0 || win >= array_size) { + if (win < 0 || (unsigned long)win >= array_size) { printf("error: invalid window"); return -1; } @@ -325,7 +325,8 @@ void export_free_gpios(void) FILE *fgpio, *fgpio_export; int i, gpio_max = 0; char *line = NULL; - ssize_t read, len; + ssize_t read; + size_t len; fgpio = fopen("/sys/kernel/debug/gpio", "r"); if (!fgpio) { @@ -342,7 +343,7 @@ void export_free_gpios(void) /* export the gpios */ while ((read = getline(&line, &len, fgpio)) != -1) { if (strstr(line, "GPIOs")) - sscanf(line, "%*[^-]-%d%*", &gpio_max); + sscanf(line, "%*[^-]-%d%*s", &gpio_max); } printf("log: total gpios = %d\n", gpio_max); diff --git a/regulator.c b/regulator.c index 0e1c2c6..18e42d8 100644 --- a/regulator.c +++ b/regulator.c @@ -59,10 +59,10 @@ struct regulator_data { }; static struct regulator_data regdata[] = { - { "name", "%s", "\tname: %s\n" }, - { "status", "%s", "\tstatus: %s\n" }, - { "state", "%s", "\tstate: %s\n" }, - { "type", "%s", "\ttype: %s\n" }, + { "name", "%s", "\tname: %s\n", false}, + { "status", "%s", "\tstatus: %s\n", false}, + { "state", "%s", "\tstate: %s\n", false}, + { "type", "%s", "\ttype: %s\n", false}, { "num_users", "%d", "\tnum_users: %d\n", true }, { "microvolts", "%d", "\tmicrovolts: %d\n", true }, { "max_microvolts", "%d", "\tmax_microvolts: %d\n", true }, @@ -92,7 +92,7 @@ static int regulator_dump_cb(struct tree *tree, void *data) if (!strncmp("regulator.", tree->name, strlen("regulator."))) printf("\n%s:\n", tree->name); - for (i = 0; i < nregdata; i++) { + for (i = 0; (unsigned long)i < nregdata; i++) { int val; if (file_read_value(tree->path, regdata[i].name, |