diff --git a/jni/ConfFileParser.cpp b/jni/ConfFileParser.cpp
index d270690..0a0883a 100644
--- a/jni/ConfFileParser.cpp
+++ b/jni/ConfFileParser.cpp
@@ -322,7 +322,6 @@
 {
   unsigned int grp_hash_code;
   unsigned int grp_index;
-  unsigned int num_of_keys;
   unsigned int i;
   unsigned int j = 0;
   unsigned int key_len;
@@ -530,8 +529,6 @@
 )
 {
   const char *line_begin;
-  char *grp_name;
-  unsigned int len;
 
   if((line == NULL) || (key_file == NULL)) {
       ALOGE("key file or line is null\n");
@@ -729,53 +726,6 @@
   }
 }
 
-static char key_exist
-(
-  const group_table *key_file,
-  const char *cur_grp,
-  const char *key
-)
-{
-  unsigned int grp_hash_code;
-  unsigned int key_hash_code;
-  unsigned int grp_index;
-  unsigned int key_index;
-  group *grp = NULL;
-  key_value_pair_list *list = NULL;
-
-  if((key_file != NULL) && (cur_grp != NULL)
-      && (key != NULL) && ((key_file->grps_hash != NULL))
-      && (strcmp(key, ""))) {
-     grp_hash_code = get_hash_code(cur_grp);
-     grp_index = (grp_hash_code % key_file->grps_hash_size);
-     grp = key_file->grps_hash[grp_index];
-     key_hash_code = get_hash_code(key);
-     while((grp != NULL)) {
-           if(!strcmp(cur_grp, grp->grp_name)) {
-              key_index = (key_hash_code % grp->keys_hash_size);
-              if(grp->list)
-                 list = grp->list[key_index];
-              while((list != NULL) && strcmp(key, list->key)) {
-                    list = list->next;
-              }
-              if(list != NULL){
-                  return TRUE;
-              }else{
-                  return FALSE;
-              }
-           }
-           grp = grp->grp_next;
-     }
-     if(!grp) {
-        return TRUE;
-     }else {
-        return FALSE;
-     }
-  }else {
-     return FALSE;
-  }
-}
-
 //checks validity of key
 //a valid key must start in
 //a seperate line and key must
diff --git a/jni/ConfigFmThs.cpp b/jni/ConfigFmThs.cpp
index 3845dfd..10bb921 100644
--- a/jni/ConfigFmThs.cpp
+++ b/jni/ConfigFmThs.cpp
@@ -344,7 +344,6 @@
     UINT fd
 )
 {
-    signed char ret = FM_SUCCESS;
     char **keys = NULL;
     char **keys_cpy = NULL;
     char *key_value = NULL;
@@ -352,7 +351,6 @@
     unsigned int *freqs_array = NULL;
     signed char *sinrs_array = NULL;
     char *sinrs = NULL;
-    int value;
     unsigned int freq_cnt = 0;
     unsigned int sinr_cnt = 0;
     FmPerformanceParams perf_params;
@@ -485,7 +483,6 @@
     const char *file, UINT fd
 )
 {
-    int index;
     struct NAME_MAP *found;
     char **grps = NULL;
     char **grps_cpy = NULL;
diff --git a/jni/FmPerformanceParams.cpp b/jni/FmPerformanceParams.cpp
index bdd0a43..9d1542f 100644
--- a/jni/FmPerformanceParams.cpp
+++ b/jni/FmPerformanceParams.cpp
@@ -377,7 +377,6 @@
    struct v4l2_ext_control ext_ctl;
    struct v4l2_ext_controls v4l2_ctls;
    unsigned int freq;
-   signed char sinr;
    unsigned int size = 0;
    char *data = NULL;
    signed char ret = FM_FAILURE;
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index 27dd2a0..d6cb073 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -78,7 +78,6 @@
     SCAN_DN
 };
 
-static JNIEnv *g_jEnv = NULL;
 static JavaVM *g_jVM = NULL;
 
 namespace android {
@@ -126,7 +125,6 @@
 static JNIEnv *mCallbackEnv = NULL;
 static jobject mCallbacksObj = NULL;
 static bool mCallbacksObjCreated = false;
-static jfieldID sCallbacksField;
 
 static jclass javaClassRef;
 static jmethodID method_psInfoCallback;
@@ -273,7 +271,7 @@
 {
     ALOGD("RT_EVT: " );
     jbyteArray rt_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -290,7 +288,6 @@
     }
 
     mCallbackEnv->SetByteArrayRegion(rt_buff, 0, len,(jbyte *)rt);
-    jbyte* bytes= mCallbackEnv->GetByteArrayElements(rt_buff,0);
 
     mCallbackEnv->CallVoidMethod(mCallbacksObj, method_rtCallback,rt_buff);
     mCallbackEnv->DeleteLocalRef(rt_buff);
@@ -299,7 +296,7 @@
 void fm_ps_update_cb(char *ps)
 {
     jbyteArray ps_data = NULL;
-    int i,len;
+    int len;
     int numPs;
     if (!checkCallbackThread())
         return;
@@ -315,7 +312,6 @@
     }
 
     mCallbackEnv->SetByteArrayRegion(ps_data, 0, len,(jbyte *)ps);
-    jbyte* bytes= mCallbackEnv->GetByteArrayElements(ps_data,0);
     mCallbackEnv->CallVoidMethod(mCallbacksObj, method_psInfoCallback,ps_data);
     mCallbackEnv->DeleteLocalRef(ps_data);
 }
@@ -350,7 +346,7 @@
 {
     ALOGD("ERT_EVT");
     jbyteArray ert_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -375,7 +371,7 @@
 {
     ALOGI("Extended Contry code ");
     jbyteArray ecc_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -656,7 +652,7 @@
         (JNIEnv* env, jobject thiz, jstring path)
 {
     int fd;
-    int i = 0, retval=0, err;
+    int i = 0, err;
     char value[PROPERTY_VALUE_MAX] = {'\0'};
     char versionStr[40] = {'\0'};
     int init_success = 0;
@@ -730,9 +726,6 @@
 static jint android_hardware_fmradio_FmReceiverJNI_closeFdNative
     (JNIEnv * env, jobject thiz, jint fd)
 {
-    int i = 0;
-    int cleanup_success = 0;
-    char retval =0;
     char value[PROPERTY_VALUE_MAX] = {'\0'};
 
     property_get("vendor.bluetooth.soc", value, NULL);
@@ -1277,7 +1270,6 @@
 {
     int i=0;
     char value[PROPERTY_VALUE_MAX] = {'\0'};
-    char firmwareVersion[80];
 
     property_get("vendor.bluetooth.soc", value, NULL);
 
