sm8250-common: power: Fix warnings

This commit is contained in:
LuK1337 2020-06-23 14:47:37 +02:00
parent e032e7cc78
commit 0e782407a5
3 changed files with 9 additions and 5 deletions

View file

@ -101,13 +101,16 @@ void power_hint(power_hint_t hint, void *data)
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;
default:
break; break;
} }
} }

View file

@ -26,6 +26,8 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#define LOG_TAG "QTI PowerHAL"
#include <cutils/log.h> #include <cutils/log.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
@ -34,7 +36,6 @@
#include <libxml/tree.h> #include <libxml/tree.h>
#include <unistd.h> #include <unistd.h>
#include "powerhintparser.h" #include "powerhintparser.h"
#define LOG_TAG "QTI PowerHAL"
int parsePowerhintXML() { int parsePowerhintXML() {

View file

@ -215,7 +215,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) {
@ -230,7 +230,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[0] == NULL) if (duration < 0 || num_args < 1 || opt_list[0] == 0)
return 0; return 0;
if (qcopt_handle) { if (qcopt_handle) {