power: Fix a few compiler warnings

* And unify styling a little bit

Change-Id: I7f9bb43a534e352fdd7693ff975749864f8addb3
This commit is contained in:
Paul Keith
2017-12-31 02:17:32 +01:00
committed by Michael Bestas
parent 2759522e9d
commit 0c54d07956
3 changed files with 8 additions and 9 deletions

View File

@@ -78,8 +78,6 @@ void power_hint(power_hint_t hint, void *data)
return; return;
} }
switch(hint) { switch(hint) {
case POWER_HINT_VSYNC:
break;
case POWER_HINT_VR_MODE: case POWER_HINT_VR_MODE:
ALOGI("VR mode power hint not handled in power_hint_override"); ALOGI("VR mode power hint not handled in power_hint_override");
break; break;
@@ -100,16 +98,16 @@ void power_hint(power_hint_t hint, void *data)
if (handles[hint].handle > 0) if (handles[hint].handle > 0)
handles[hint].ref_count++; handles[hint].ref_count++;
} } else {
else
if (handles[hint].handle > 0) { if (handles[hint].handle > 0) {
if (--handles[hint].ref_count == 0) { if (--handles[hint].ref_count == 0) {
release_request(handles[hint].handle); release_request(handles[hint].handle);
handles[hint].handle = 0; handles[hint].handle = 0;
} }
} } else {
else
ALOGE("Lock for hint: %X was not acquired, cannot be released", hint); ALOGE("Lock for hint: %X was not acquired, cannot be released", hint);
}
}
break; break;
default: default:
break; break;

View File

@@ -231,7 +231,7 @@ void interaction(int duration, int num_args, int opt_list[])
#ifdef INTERACTION_BOOST #ifdef INTERACTION_BOOST
static int lock_handle = 0; static int lock_handle = 0;
if (duration < 0 || num_args < 1 || opt_list[0] == NULL) if (duration < 0 || num_args < 1 || opt_list[0] == 0)
return; return;
if (qcopt_handle) { if (qcopt_handle) {
@@ -246,7 +246,7 @@ void interaction(int duration, int num_args, int opt_list[])
int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[]) int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[])
{ {
if (duration < 0 || num_args < 1 || opt_list == NULL) if (duration < 0 || num_args < 1 || opt_list[0] == 0)
return 0; return 0;
if (qcopt_handle) { if (qcopt_handle) {

View File

@@ -42,6 +42,7 @@ int is_interactive_governor(char*);
void perform_hint_action(int hint_id, int resource_values[], void perform_hint_action(int hint_id, int resource_values[],
int num_resources); int num_resources);
void undo_hint_action(int hint_id); void undo_hint_action(int hint_id);
void undo_initial_hint_action();
void release_request(int lock_handle); void release_request(int lock_handle);
int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[]); int interaction_with_handle(int lock_handle, int duration, int num_args, int opt_list[]);
int perf_hint_enable(int hint_id, int duration); int perf_hint_enable(int hint_id, int duration);