power: Compile with -Wall -Wextra -Werror
* And fix the build errors
Change-Id: I183203edfd92d4672893d74aa7428bc9f5e17772
diff --git a/Android.mk b/Android.mk
index 44403fa..521574b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,6 +14,8 @@
LOCAL_HEADER_LIBRARIES += libhardware_headers
LOCAL_SRC_FILES := power-common.c metadata-parser.c utils.c list.c hint-data.c Power.cpp main.cpp PowerHintSession.cpp
+LOCAL_CFLAGS += -Wall -Wextra -Werror
+
ifneq ($(BOARD_POWER_CUSTOM_BOARD_LIB),)
LOCAL_WHOLE_STATIC_LIBRARIES += $(BOARD_POWER_CUSTOM_BOARD_LIB)
else
diff --git a/power-660.c b/power-660.c
index d5e55d8..50c3eeb 100644
--- a/power-660.c
+++ b/power-660.c
@@ -53,10 +53,8 @@
static int display_hint_sent;
static int video_encode_hint_sent;
-static int cam_preview_hint_sent;
static void process_video_encode_hint(void *metadata);
-//static void process_cam_preview_hint(void *metadata);
/* Returns true is target is SDM630/SDM455 else false*/
static bool is_target_SDM630()
@@ -91,6 +89,8 @@
process_video_encode_hint(data);
return HINT_HANDLED;
}
+ default:
+ break;
}
return HINT_NONE;
}
@@ -98,11 +98,8 @@
int set_interactive_override(int on)
{
char governor[80];
- char tmp_str[NODE_MAX];
int resource_values[20];
int num_resources;
- struct video_encode_metadata_t video_encode_metadata;
- int rc;
ALOGI("Got set_interactive hint");
diff --git a/power-8937.c b/power-8937.c
index 3342f13..d82ac9e 100644
--- a/power-8937.c
+++ b/power-8937.c
@@ -87,6 +87,8 @@
process_video_encode_hint(data);
return HINT_HANDLED;
}
+ default:
+ break;
}
return HINT_NONE;
}
@@ -94,8 +96,6 @@
int set_interactive_override(int on)
{
char governor[80];
- char tmp_str[NODE_MAX];
- struct video_encode_metadata_t video_encode_metadata;
static int set_i_count = 0;
ALOGI("Got set_interactive hint");
diff --git a/power-8953.c b/power-8953.c
index 28fa620..33c572d 100644
--- a/power-8953.c
+++ b/power-8953.c
@@ -53,10 +53,8 @@
static int display_hint_sent;
static int video_encode_hint_sent;
-static int cam_preview_hint_sent;
static void process_video_encode_hint(void *metadata);
-//static void process_cam_preview_hint(void *metadata);
static bool is_target_SDM632() /* Returns value=632 if target is SDM632 else value 0 */
{
@@ -90,6 +88,8 @@
process_video_encode_hint(data);
return HINT_HANDLED;
}
+ default:
+ break;
}
return HINT_NONE;
}
@@ -97,8 +97,6 @@
int set_interactive_override(int on)
{
char governor[80];
- char tmp_str[NODE_MAX];
- struct video_encode_metadata_t video_encode_metadata;
static int set_i_count = 0;
ALOGI("Got set_interactive hint");
diff --git a/power-common.h b/power-common.h
index e2179d0..d5c6d1e 100644
--- a/power-common.h
+++ b/power-common.h
@@ -33,8 +33,6 @@
extern "C" {
#endif
-#define NODE_MAX (64)
-
#define SCALING_GOVERNOR_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
#define INTERACTIVE_GOVERNOR "interactive"
#define SCHEDUTIL_GOVERNOR "schedutil"