From 373d3c7257fa815d0b9ee8f16874470a6002042e Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 18 Oct 2017 16:28:14 -0700 Subject: Use -Werror in system/extras * Remove unused variables. * Fix redefined macro warnings. * Fix sign-compare warnings. * Fix 'return false' in main(). * Keep existing warnings to fix later. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: Ib92ef5297693595fb84ed4f8e61665bda4cee312 --- latencytop/Android.mk | 2 +- latencytop/latencytop.c | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'latencytop') diff --git a/latencytop/Android.mk b/latencytop/Android.mk index 220f4e36..6649a83b 100644 --- a/latencytop/Android.mk +++ b/latencytop/Android.mk @@ -23,6 +23,6 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) LOCAL_MODULE_TAGS := debug -LOCAL_CFLAGS := -Wno-unused-parameter +LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter include $(BUILD_EXECUTABLE) diff --git a/latencytop/latencytop.c b/latencytop/latencytop.c index 667fbf7e..d20bd7f5 100644 --- a/latencytop/latencytop.c +++ b/latencytop/latencytop.c @@ -46,11 +46,9 @@ static struct latency_entry *read_process_stats(struct latency_entry *list, int static struct latency_entry *read_thread_stats(struct latency_entry *list, int erase, int pid, int tid, int fatal); static struct latency_entry *alloc_latency_entry(void); -static void free_latency_entry(struct latency_entry *e); static void set_latencytop(int on); static struct latency_entry *read_latency_file(FILE *f, struct latency_entry *list); -static void erase_latency_file(FILE *f); static struct latency_entry *find_latency_entry(struct latency_entry *e, char *reason); static void print_latency_entries(struct latency_entry *head); @@ -286,11 +284,6 @@ static struct latency_entry *alloc_latency_entry(void) { return e; } -static void free_latency_entry(struct latency_entry *e) { - e->next = free_entries; - free_entries = e; -} - static struct latency_entry *find_latency_entry(struct latency_entry *head, char *reason) { struct latency_entry *e; @@ -319,10 +312,6 @@ static void set_latencytop(int on) { fclose(f); } -static void erase_latency_file(FILE *f) { - fprintf(f, "erase\n"); -} - static struct latency_entry *read_latency_file(FILE *f, struct latency_entry *list) { struct latency_entry *e, *head; char line[MAX_LINE]; -- cgit v1.2.3