summaryrefslogtreecommitdiff
path: root/liblight
diff options
context:
space:
mode:
authorArun Kumar K.R <akumarkr@codeaurora.org>2014-01-21 21:32:36 -0800
committerArun Kumar K.R <akumarkr@codeaurora.org>2014-01-31 11:40:02 -0800
commit0efad603dc9d7086525da55c49325c1253a15e19 (patch)
tree4265456dd07bc82de3efce9b047bcc4ba10c76bc /liblight
parentf15adc04ced3f7fe22eed5323ce4b625513809ab (diff)
downloaddisplay-0efad603dc9d7086525da55c49325c1253a15e19.tar.gz
liblights: fix compiler warnings
- Use unused variable dev in the module - remove unused local variables Change-Id: Icb0cc033023640fd785abce9d00b467978500396
Diffstat (limited to 'liblight')
-rw-r--r--liblight/lights.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/liblight/lights.c b/liblight/lights.c
index ccfbe102..229777a3 100644
--- a/liblight/lights.c
+++ b/liblight/lights.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2014 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,6 +116,9 @@ set_light_backlight(struct light_device_t* dev,
{
int err = 0;
int brightness = rgb_to_brightness(state);
+ if(!dev) {
+ return -1;
+ }
pthread_mutex_lock(&g_lock);
err = write_int(LCD_FILE, brightness);
pthread_mutex_unlock(&g_lock);
@@ -125,12 +129,15 @@ static int
set_speaker_light_locked(struct light_device_t* dev,
struct light_state_t const* state)
{
- int len;
- int alpha, red, green, blue;
+ int red, green, blue;
int blink;
int onMS, offMS;
unsigned int colorRGB;
+ if(!dev) {
+ return -1;
+ }
+
switch (state->flashMode) {
case LIGHT_FLASH_TIMED:
onMS = state->flashOnMS;
@@ -217,6 +224,9 @@ set_light_buttons(struct light_device_t* dev,
struct light_state_t const* state)
{
int err = 0;
+ if(!dev) {
+ return -1;
+ }
pthread_mutex_lock(&g_lock);
err = write_int(BUTTON_FILE, state->color & 0xFF);
pthread_mutex_unlock(&g_lock);