diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index e41bf06..35a4e5d 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -390,12 +390,12 @@
 }
 
 
-void rds_grp_cntrs_rsp_cb(char * evt_buffer)
+void rds_grp_cntrs_rsp_cb(char * evt_buffer __unused)
 {
    ALOGD("rds_grp_cntrs_rsp_cb");
 }
 
-void rds_grp_cntrs_ext_rsp_cb(char * evt_buffer)
+void rds_grp_cntrs_ext_rsp_cb(char * evt_buffer __unused)
 {
    ALOGE("rds_grp_cntrs_ext_rsp_cb");
 }
@@ -410,19 +410,19 @@
     mCallbacksObjCreated = false;
 }
 
-void fm_peek_rsp_cb(char *peek_rsp) {
+void fm_peek_rsp_cb(char *peek_rsp __unused) {
     ALOGD("fm_peek_rsp_cb");
 }
 
-void fm_ssbi_peek_rsp_cb(char *ssbi_peek_rsp){
+void fm_ssbi_peek_rsp_cb(char *ssbi_peek_rsp __unused){
     ALOGD("fm_ssbi_peek_rsp_cb");
 }
 
-void fm_agc_gain_rsp_cb(char *agc_gain_rsp){
+void fm_agc_gain_rsp_cb(char *agc_gain_rsp __unused){
     ALOGE("fm_agc_gain_rsp_cb");
 }
 
-void fm_ch_det_th_rsp_cb(char *ch_det_rsp){
+void fm_ch_det_th_rsp_cb(char *ch_det_rsp __unused){
     ALOGD("fm_ch_det_th_rsp_cb");
 }
 
@@ -649,7 +649,7 @@
 };
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
-        (JNIEnv* env, jobject thiz, jstring path)
+        (JNIEnv* env, jobject thiz __unused, jstring path)
 {
     int fd;
     int i = 0, err;
@@ -724,7 +724,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_closeFdNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
     char value[PROPERTY_VALUE_MAX] = {'\0'};
 
@@ -757,7 +757,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getFreqNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused)
 {
     int err;
     long freq;
@@ -792,7 +792,7 @@
 
 /*native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_setFreqNative
-    (JNIEnv * env, jobject thiz, jint fd, jint freq)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint freq)
 {
     int err;
     if (is_soc_cherokee())
@@ -820,7 +820,8 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_setControlNative
-    (JNIEnv * env, jobject thiz, jint fd, jint id, jint value)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint id,
+    jint value)
 {
     int err;
     ALOGE("id(%x) value: %x\n", id, value);
@@ -848,7 +849,8 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_SetCalibrationNative
-     (JNIEnv * env, jobject thiz, jint fd, jbyteArray buff)
+     (JNIEnv * env __unused, jobject thiz __unused, jint fd,
+     jbyteArray buff __unused)
 {
 
    int err;
@@ -870,7 +872,7 @@
 }
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getControlNative
-    (JNIEnv * env, jobject thiz, jint fd, jint id)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint id)
 {
     int err;
     long val;
@@ -908,7 +910,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_startSearchNative
-    (JNIEnv * env, jobject thiz, jint fd, jint dir)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint dir)
 {
     int err;
     if (is_soc_cherokee())
@@ -943,7 +945,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_cancelSearchNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused)
 {
     int err;
 
@@ -978,7 +980,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getRSSINative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused)
 {
     int err;
     long rmssi;
@@ -1014,7 +1016,8 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_setBandNative
-    (JNIEnv * env, jobject thiz, jint fd, jint low, jint high)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint low,
+    jint high)
 {
     int err;
     if (is_soc_cherokee())
@@ -1055,7 +1058,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getLowerBandNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
     int err;
     ULINT freq;
@@ -1091,7 +1094,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getUpperBandNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
     int err;
     ULINT freq;
@@ -1126,7 +1129,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_setMonoStereoNative
-    (JNIEnv * env, jobject thiz, jint fd, jint val)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint val)
 {
 
     int err;
@@ -1160,7 +1163,7 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getBufferNative
- (JNIEnv * env, jobject thiz, jint fd, jbyteArray buff, jint index)
+    (JNIEnv * env, jobject thiz __unused, jint fd, jbyteArray buff, jint index)
 {
     int err;
     jboolean isCopy;
@@ -1190,7 +1193,8 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getRawRdsNative
- (JNIEnv * env, jobject thiz, jint fd, jbooleanArray buff, jint count)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jbooleanArray buff,
+    jint count)
 {
 
     return (read (fd, buff, count));
@@ -1198,7 +1202,9 @@
 }
 
 /* native interface */
-static jint android_hardware_fmradio_FmReceiverJNI_setNotchFilterNative(JNIEnv * env, jobject thiz,jint fd, jint id, jboolean aValue)
+static jint android_hardware_fmradio_FmReceiverJNI_setNotchFilterNative
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint id,
+    jboolean aValue)
 {
     char value[PROPERTY_VALUE_MAX] = {'\0'};
 #ifndef QCOM_NO_FM_FIRMWARE
@@ -1266,7 +1272,8 @@
 
 
 /* native interface */
-static jint android_hardware_fmradio_FmReceiverJNI_setAnalogModeNative(JNIEnv * env, jobject thiz, jboolean aValue)
+static jint android_hardware_fmradio_FmReceiverJNI_setAnalogModeNative
+    (JNIEnv * env __unused, jobject thiz __unused, jboolean aValue __unused)
 {
     int i=0;
     char value[PROPERTY_VALUE_MAX] = {'\0'};
@@ -1304,7 +1311,7 @@
 
 /*native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_setPTYNative
-    (JNIEnv * env, jobject thiz, jint fd, jint pty)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint pty)
 {
     int masked_pty;
     int err;
@@ -1329,7 +1336,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_setPINative
-    (JNIEnv * env, jobject thiz, jint fd, jint pi)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint pi)
 {
     int err;
     int masked_pi;
@@ -1354,7 +1361,8 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_startRTNative
-    (JNIEnv * env, jobject thiz, jint fd, jstring radio_text, jint count )
+    (JNIEnv * env, jobject thiz __unused, jint fd, jstring radio_text,
+    jint count __unused)
 {
     ALOGE("->android_hardware_fmradio_FmReceiverJNI_startRTNative\n");
 
@@ -1412,7 +1420,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_stopRTNative
-    (JNIEnv * env, jobject thiz, jint fd )
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
     int err;
 
@@ -1434,7 +1442,8 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_startPSNative
-    (JNIEnv * env, jobject thiz, jint fd, jstring buff, jint count )
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd,
+    jstring buff, jint count __unused)
 {
     ALOGD("->android_hardware_fmradio_FmReceiverJNI_startPSNative\n");
 
@@ -1491,7 +1500,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_stopPSNative
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
 
     int err;
@@ -1515,7 +1524,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_configureSpurTable
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
     int err;
 
@@ -1538,7 +1547,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_setPSRepeatCountNative
-    (JNIEnv * env, jobject thiz, jint fd, jint repCount)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint repCount)
 {
     int masked_ps_repeat_cnt;
     int err;
@@ -1563,7 +1572,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_setTxPowerLevelNative
-    (JNIEnv * env, jobject thiz, jint fd, jint powLevel)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd, jint powLevel)
 {
     int err;
 
@@ -1586,7 +1595,7 @@
 }
 
 static void android_hardware_fmradio_FmReceiverJNI_configurePerformanceParams
-    (JNIEnv * env, jobject thiz, jint fd)
+    (JNIEnv * env __unused, jobject thiz __unused, jint fd)
 {
 
      ConfigFmThs thsObj;
@@ -1596,7 +1605,8 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_setSpurDataNative
- (JNIEnv * env, jobject thiz, jint fd, jshortArray buff, jint count)
+    (JNIEnv * env, jobject thiz __unused, jint fd, jshortArray buff,
+    jint count)
 {
     ALOGE("entered JNI's setSpurDataNative\n");
     int err, i = 0;
@@ -1634,7 +1644,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_enableSlimbusNative
- (JNIEnv * env, jobject thiz, jint fd, jint val)
+ (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint val)
 {
     ALOGD("%s: val = %d\n", __func__, val);
     int err = JNI_ERR;
@@ -1645,7 +1655,7 @@
 }
 
 static jint android_hardware_fmradio_FmReceiverJNI_enableSoftMuteNative
- (JNIEnv * env, jobject thiz, jint fd, jint val)
+ (JNIEnv * env __unused, jobject thiz __unused, jint fd __unused, jint val)
 {
     ALOGD("%s: val = %d\n", __func__, val);
     int err = JNI_ERR;
@@ -1655,7 +1665,7 @@
     return err;
 }
 
-static void classInitNative(JNIEnv* env, jclass clazz) {
+static void classInitNative(JNIEnv* env __unused, jclass clazz __unused) {
 
     ALOGI("ClassInit native called \n");
     jclass dataClass = env->FindClass("qcom/fmradio/FmReceiverJNI");
@@ -1709,7 +1719,7 @@
     lib_handle = NULL;
 }
 
-static void initNative(JNIEnv *env, jobject object) {
+static void initNative(JNIEnv *env __unused, jobject object __unused) {
 
 if (is_soc_cherokee()) {
     int status;
@@ -1728,7 +1738,7 @@
 }
 }
 
-static void cleanupNative(JNIEnv *env, jobject object) {
+static void cleanupNative(JNIEnv *env __unused, jobject object __unused) {
 
     if (is_soc_cherokee()) {
         if (mCallbacksObj != NULL) {
@@ -1815,7 +1825,7 @@
 }
 } // end namespace
 
-jint JNI_OnLoad(JavaVM *jvm, void *reserved)
+jint JNI_OnLoad(JavaVM *jvm, void *reserved __unused)
 {
     JNIEnv *e;
     int status;
