Major warnings cleanup

Mostly fixing unused parameter warnings.
A few other warnings also fixed like possible use of
unitialized variables (no real issue found, just compiler couldn't
follow the path), signed vs unsigned warning.

Also fixed some typos, indent issues, removal of dead code, etc.

Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01
Signed-off-by: Mike J. Chen <mjchen@google.com>
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index 42e416e..cde56c1 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -43,6 +43,7 @@
 
 #include <hardware/hardware.h>
 #include "audio_a2dp_hw.h"
+#include "bt_utils.h"
 
 #define LOG_TAG "audio_a2dp_hw"
 /* #define LOG_NDEBUG 0 */
@@ -150,6 +151,8 @@
     static struct timespec prev = {0,0};
     unsigned long long now_us;
     unsigned long long diff_us;
+    UNUSED(tag);
+    UNUSED(val);
 
     clock_gettime(CLOCK_MONOTONIC, &now);
 
@@ -543,6 +546,7 @@
 
 static int out_set_format(struct audio_stream *stream, audio_format_t format)
 {
+    UNUSED(format);
     struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
     DEBUG("setting format not yet supported (0x%x)", format);
     return -ENOSYS;
@@ -551,8 +555,6 @@
 static int out_standby(struct audio_stream *stream)
 {
     struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
-    int retval = 0;
-
     int retVal = 0;
 
     FNLOG();
@@ -570,6 +572,7 @@
 
 static int out_dump(const struct audio_stream *stream, int fd)
 {
+    UNUSED(fd);
     struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
     FNLOG();
     return 0;
@@ -631,6 +634,7 @@
 
 static char * out_get_parameters(const struct audio_stream *stream, const char *keys)
 {
+    UNUSED(keys);
     struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
 
     FNLOG();
@@ -659,6 +663,10 @@
 static int out_set_volume(struct audio_stream_out *stream, float left,
                           float right)
 {
+    UNUSED(stream);
+    UNUSED(left);
+    UNUSED(right);
+
     FNLOG();
 
     /* volume controlled in audioflinger mixer (digital) */
@@ -671,18 +679,27 @@
 static int out_get_render_position(const struct audio_stream_out *stream,
                                    uint32_t *dsp_frames)
 {
+    UNUSED(stream);
+    UNUSED(dsp_frames);
+
     FNLOG();
     return -EINVAL;
 }
 
 static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
 {
+    UNUSED(stream);
+    UNUSED(effect);
+
     FNLOG();
     return 0;
 }
 
 static int out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
 {
+    UNUSED(stream);
+    UNUSED(effect);
+
     FNLOG();
     return 0;
 }
@@ -693,54 +710,76 @@
 
 static uint32_t in_get_sample_rate(const struct audio_stream *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return 8000;
 }
 
 static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate)
 {
+    UNUSED(stream);
+    UNUSED(rate);
+
     FNLOG();
     return 0;
 }
 
 static size_t in_get_buffer_size(const struct audio_stream *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return 320;
 }
 
 static uint32_t in_get_channels(const struct audio_stream *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return AUDIO_CHANNEL_IN_MONO;
 }
 
 static audio_format_t in_get_format(const struct audio_stream *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return AUDIO_FORMAT_PCM_16_BIT;
 }
 
 static int in_set_format(struct audio_stream *stream, audio_format_t format)
 {
+    UNUSED(stream);
+    UNUSED(format);
+
     FNLOG();
     return 0;
 }
 
 static int in_standby(struct audio_stream *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return 0;
 }
 
 static int in_dump(const struct audio_stream *stream, int fd)
 {
+    UNUSED(stream);
+    UNUSED(fd);
+
     FNLOG();
     return 0;
 }
 
 static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
 {
+    UNUSED(stream);
+    UNUSED(kvpairs);
+
     FNLOG();
     return 0;
 }
@@ -748,12 +787,18 @@
 static char * in_get_parameters(const struct audio_stream *stream,
                                 const char *keys)
 {
+    UNUSED(stream);
+    UNUSED(keys);
+
     FNLOG();
     return strdup("");
 }
 
 static int in_set_gain(struct audio_stream_in *stream, float gain)
 {
+    UNUSED(stream);
+    UNUSED(gain);
+
     FNLOG();
     return 0;
 }
@@ -761,24 +806,36 @@
 static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
                        size_t bytes)
 {
+    UNUSED(stream);
+    UNUSED(buffer);
+    UNUSED(bytes);
+
     FNLOG();
     return bytes;
 }
 
 static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
 {
+    UNUSED(stream);
+
     FNLOG();
     return 0;
 }
 
 static int in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
 {
+    UNUSED(stream);
+    UNUSED(effect);
+
     FNLOG();
     return 0;
 }
 
 static int in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
 {
+    UNUSED(stream);
+    UNUSED(effect);
+
     FNLOG();
 
     return 0;
@@ -796,6 +853,9 @@
     struct a2dp_stream_out *out;
     int ret = 0;
     int i;
+    UNUSED(handle);
+    UNUSED(devices);
+    UNUSED(flags);
 
     INFO("opening output");
 
@@ -908,6 +968,7 @@
                                   const char *keys)
 {
     struct str_parms *parms;
+    UNUSED(dev);
 
     FNLOG();
 
@@ -931,6 +992,9 @@
 
 static int adev_set_voice_volume(struct audio_hw_device *dev, float volume)
 {
+    UNUSED(dev);
+    UNUSED(volume);
+
     FNLOG();
 
     return -ENOSYS;
@@ -938,6 +1002,9 @@
 
 static int adev_set_master_volume(struct audio_hw_device *dev, float volume)
 {
+    UNUSED(dev);
+    UNUSED(volume);
+
     FNLOG();
 
     return -ENOSYS;
@@ -945,6 +1012,9 @@
 
 static int adev_set_mode(struct audio_hw_device *dev, int mode)
 {
+    UNUSED(dev);
+    UNUSED(mode);
+
     FNLOG();
 
     return 0;
@@ -952,6 +1022,9 @@
 
 static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
 {
+    UNUSED(dev);
+    UNUSED(state);
+
     FNLOG();
 
     return -ENOSYS;
@@ -959,6 +1032,9 @@
 
 static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
 {
+    UNUSED(dev);
+    UNUSED(state);
+
     FNLOG();
 
     return -ENOSYS;
@@ -967,6 +1043,9 @@
 static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
                                          const struct audio_config *config)
 {
+    UNUSED(dev);
+    UNUSED(config);
+
     FNLOG();
 
     return 320;
@@ -981,6 +1060,9 @@
     struct a2dp_audio_device *ladev = (struct a2dp_audio_device *)dev;
     struct a2dp_stream_in *in;
     int ret;
+    UNUSED(handle);
+    UNUSED(devices);
+    UNUSED(config);
 
     FNLOG();
 
@@ -1017,6 +1099,9 @@
 static void adev_close_input_stream(struct audio_hw_device *dev,
                                    struct audio_stream_in *in)
 {
+    UNUSED(dev);
+    UNUSED(in);
+
     FNLOG();
 
     return;
@@ -1024,6 +1109,9 @@
 
 static int adev_dump(const audio_hw_device_t *device, int fd)
 {
+    UNUSED(device);
+    UNUSED(fd);
+
     FNLOG();
 
     return 0;
diff --git a/bta/ag/bta_ag_act.c b/bta/ag/bta_ag_act.c
index 5f72444..11fc85c 100644
--- a/bta/ag/bta_ag_act.c
+++ b/bta/ag/bta_ag_act.c
@@ -334,6 +334,8 @@
 *******************************************************************************/
 void bta_ag_disc_fail(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* reopen registered servers */
     bta_ag_start_servers(p_scb, p_scb->reg_services);
 
@@ -371,6 +373,8 @@
 *******************************************************************************/
 void bta_ag_rfc_fail(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* reinitialize stuff */
     p_scb->conn_handle = 0;
     p_scb->conn_service = 0;
@@ -405,6 +409,7 @@
     tBTA_AG_HDR    close;
     tBTA_SERVICE_MASK services;
     int i, num_active_conn = 0;
+    UNUSED(p_data);
 
 #ifdef  _WIN32_WCE
     /* The BTE RFCOMM automatically removes the connection when closed, but BTW does not */
@@ -637,6 +642,7 @@
 {
     UINT16  len;
     char    buf[BTA_AG_RFC_READ_MAX];
+    UNUSED(p_data);
 
     memset(buf, 0, BTA_AG_RFC_READ_MAX);
 
@@ -796,6 +802,7 @@
 void bta_ag_svc_conn_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
     tBTA_AG_CONN evt;
+    UNUSED(p_data);
 
     if (!p_scb->svc_conn)
     {
@@ -856,6 +863,8 @@
 *******************************************************************************/
 void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     APPL_TRACE_DEBUG1("bta_ag_rcvd_slc_ready: handle = %d", bta_ag_scb_to_idx(p_scb));
 
     if (bta_ag_cb.parse_mode == BTA_AG_PASS_THROUGH)
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index c035cf3..54cd4d3 100644
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -631,6 +631,7 @@
 {
     UINT8   retval = 0;
     INT16   idx = -1;
+    UNUSED(p_scb);
 
     if (p_s[1] != 0)
     {
@@ -1747,6 +1748,9 @@
     {
         APPL_TRACE_ERROR1("bta_ag_setcodec error: unsupported codec type %d", codec_type);
     }
+#else
+    UNUSED(p_scb);
+    UNUSED(p_data);
 #endif
 }
 
@@ -1801,6 +1805,8 @@
 *******************************************************************************/
 void bta_ag_send_ring(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
 #if defined(BTA_AG_MULTI_RESULT_INCLUDED) && (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
     tBTA_AG_MULTI_RESULT_CB m_res_cb;
 
diff --git a/bta/ag/bta_ag_main.c b/bta/ag/bta_ag_main.c
index 9b28067..bae992b 100644
--- a/bta/ag/bta_ag_main.c
+++ b/bta/ag/bta_ag_main.c
@@ -28,6 +28,7 @@
 #include "bta_ag_co.h"
 #include "bta_ag_int.h"
 #include "bd.h"
+#include "utl.h"
 
 /*****************************************************************************
 ** Constants and types
@@ -586,6 +587,8 @@
 {
     UINT16  handle;
     tBTA_AG_SCB *p_scb;
+    UNUSED(status);
+    UNUSED(app_id);
 
     /* Check if we have opening scb for the peer device. */
     handle = bta_ag_idx_by_bdaddr (peer_addr);
diff --git a/bta/ag/bta_ag_rfc.c b/bta/ag/bta_ag_rfc.c
index 3575020..d6b5329 100644
--- a/bta/ag/bta_ag_rfc.c
+++ b/bta/ag/bta_ag_rfc.c
@@ -34,6 +34,7 @@
 #include "rfcdefs.h"
 #include "gki.h"
 #include "bd.h"
+#include "utl.h"
 
 /* Event mask for RfCOMM port callback */
 #define BTA_AG_PORT_EV_MASK         PORT_EV_RXCHAR
@@ -89,6 +90,7 @@
 {
     BT_HDR      *p_buf;
     tBTA_AG_SCB *p_scb;
+    UNUSED(code);
 
     if ((p_scb = bta_ag_scb_by_idx(handle)) != NULL)
     {
@@ -195,6 +197,8 @@
 *******************************************************************************/
 static int bta_ag_data_cback(UINT16 port_handle, void *p_data, UINT16 len, UINT16 handle)
 {
+    UNUSED(port_handle);
+
     /* call data call-out directly */
     bta_ag_co_tx_write(handle, (UINT8 *) p_data, len);
     return 0;
@@ -400,6 +404,7 @@
 void bta_ag_rfc_do_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
     tBTA_AG_RFC     *p_buf;
+    UNUSED(p_data);
 
     if (p_scb->conn_handle)
     {
diff --git a/bta/ag/bta_ag_sco.c b/bta/ag/bta_ag_sco.c
index 0c811b4..87d9188 100644
--- a/bta/ag/bta_ag_sco.c
+++ b/bta/ag/bta_ag_sco.c
@@ -31,6 +31,7 @@
 #include "bta_ag_int.h"
 #include "btm_api.h"
 #include "gki.h"
+#include "utl.h"
 
 #ifndef BTA_AG_SCO_DEBUG
 #define BTA_AG_SCO_DEBUG FALSE
@@ -1277,6 +1278,7 @@
 *******************************************************************************/
 void bta_ag_sco_listen(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
     bta_ag_sco_event(p_scb, BTA_AG_SCO_LISTEN_E);
 }
 
@@ -1293,6 +1295,7 @@
 void bta_ag_sco_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
     UINT8 event;
+    UNUSED(p_data);
 
     /* if another scb using sco, this is a transfer */
     if (bta_ag_cb.sco.p_curr_scb != NULL && bta_ag_cb.sco.p_curr_scb != p_scb)
@@ -1320,6 +1323,8 @@
 *******************************************************************************/
 void bta_ag_sco_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* if scb is in use */
 #if (BTM_WBS_INCLUDED == TRUE )
     /* sco_idx is not allocated in SCO_CODEC_ST, we still need to move to listening state. */
@@ -1371,6 +1376,8 @@
 *******************************************************************************/
 void bta_ag_sco_shutdown(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     bta_ag_sco_event(p_scb, BTA_AG_SCO_SHUTDOWN_E);
 }
 
@@ -1386,6 +1393,8 @@
 *******************************************************************************/
 void bta_ag_sco_conn_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     bta_ag_sco_event(p_scb, BTA_AG_SCO_CONN_OPEN_E);
 
     bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
@@ -1416,6 +1425,7 @@
 void bta_ag_sco_conn_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
     UINT16 handle = bta_ag_scb_to_idx(p_scb);
+    UNUSED(p_data);
 
     /* clear current scb */
     bta_ag_cb.sco.p_curr_scb = NULL;
@@ -1560,6 +1570,9 @@
 *******************************************************************************/
 void bta_ag_ci_sco_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_scb);
+    UNUSED(p_data);
+
 #if (BTM_SCO_HCI_INCLUDED == TRUE )
     bta_ag_sco_event(p_scb, BTA_AG_SCO_CI_DATA_E);
 #endif
diff --git a/bta/ag/bta_ag_sdp.c b/bta/ag/bta_ag_sdp.c
index d708cf2..333cb1b 100644
--- a/bta/ag/bta_ag_sdp.c
+++ b/bta/ag/bta_ag_sdp.c
@@ -31,6 +31,7 @@
 #include "sdp_api.h"
 #include "btm_api.h"
 #include "gki.h"
+#include "utl.h"
 
 /* Number of protocol elements in protocol element list. */
 #define BTA_AG_NUM_PROTO_ELEMS      2
@@ -256,6 +257,7 @@
     tBTA_SERVICE_MASK   services;
     tBTA_SERVICE_MASK   others = 0;
     int                 i;
+    UNUSED(p_data);
 
     /* get services of all other registered servers */
     for (i = 0; i < BTA_AG_NUM_IDX; i++, p++)
@@ -492,6 +494,8 @@
 *******************************************************************************/
 void bta_ag_free_db(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
 {
+    UNUSED(p_data);
+
     if (p_scb->p_disc_db != NULL)
     {
         GKI_freebuf(p_scb->p_disc_db);
diff --git a/bta/av/bta_av_aact.c b/bta/av/bta_av_aact.c
index a50fb80..fed838a 100644
--- a/bta/av/bta_av_aact.c
+++ b/bta/av/bta_av_aact.c
@@ -288,6 +288,7 @@
 *******************************************************************************/
 void bta_av_st_rc_timer(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG2("bta_av_st_rc_timer rc_handle:%d, use_rc: %d",
         p_scb->rc_handle, p_scb->use_rc);
@@ -681,6 +682,7 @@
 {
     tBTA_AV_RS_RES      switch_res = BTA_AV_RS_NONE;
     tBTA_AV_API_OPEN  *p_buf = &p_scb->q_info.open;
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG1("bta_av_switch_role wait:x%x", p_scb->wait);
     if (p_scb->wait & BTA_AV_WAIT_ROLE_SW_RES_START)
@@ -947,6 +949,7 @@
     tBTA_AV_CONN_CHG msg;
     int             xx;
     UINT8           role = BTA_AV_ROLE_AD_INT;
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG0("bta_av_cleanup");
 
@@ -999,6 +1002,7 @@
 *******************************************************************************/
 void bta_av_free_sdb(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
     utl_freebuf((void **) &p_scb->p_disc_db);
 }
 
@@ -1017,6 +1021,7 @@
     tAVDT_SEP_INFO       *p_info;
     tAVDT_CFG            *p_evt_cfg = &p_data->str_msg.cfg;
     UINT8   psc_mask = (p_evt_cfg->psc_mask | p_scb->cfg.psc_mask);
+    UNUSED(p_data);
 
     p_scb->avdt_label = p_data->str_msg.msg.hdr.label;
     memcpy(p_scb->cfg.codec_info, p_evt_cfg->codec_info, AVDT_CODEC_SIZE);
@@ -1076,6 +1081,8 @@
 void bta_av_disconnect_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
     tBTA_AV_RCB *p_rcb;
+    UNUSED(p_data);
+
     APPL_TRACE_DEBUG1("bta_av_disconnect_req conn_lcb: 0x%x", bta_av_cb.conn_lcb);
 
     bta_sys_stop_timer(&bta_av_cb.sig_tmr);
@@ -1346,6 +1353,8 @@
 *******************************************************************************/
 void bta_av_do_close (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* stop stream if started */
     if (p_scb->co_started)
     {
@@ -1381,6 +1390,8 @@
 *******************************************************************************/
 void bta_av_connect_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     utl_freebuf((void **) &p_scb->p_disc_db);
 
     if (p_scb->coll_mask & BTA_AV_COLL_INC_TMR)
@@ -1570,6 +1581,8 @@
 *******************************************************************************/
 void bta_av_set_use_rc (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     p_scb->use_rc = TRUE;
 }
 
@@ -1585,6 +1598,8 @@
 void bta_av_cco_close (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
     UINT16 mtu;
+    UNUSED(p_data);
+
     mtu = bta_av_chk_mtu(p_scb, BTA_AV_MAX_A2DP_MTU);
 
     p_scb->p_cos->close(p_scb->hndl, p_scb->codec_type, mtu);
@@ -1742,6 +1757,8 @@
 *******************************************************************************/
 void bta_av_discover_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* send avdtp discover request */
 
     AVDT_DiscoverReq(p_scb->peer_addr, p_scb->sep_info, BTA_AV_NUM_SEPS, bta_av_dt_cback[p_scb->hdi]);
@@ -1997,6 +2014,7 @@
     BOOLEAN new_buf = FALSE;
     UINT8   m_pt = 0x60 | p_scb->codec_type;
     tAVDT_DATA_OPT_MASK     opt;
+    UNUSED(p_data);
 
     if (!p_scb->cong)
     {
@@ -2260,6 +2278,8 @@
 *******************************************************************************/
 void bta_av_start_failed (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     if(p_scb->started == FALSE && p_scb->co_started == FALSE)
     {
         bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
@@ -2344,6 +2364,8 @@
 *******************************************************************************/
 void bta_av_clr_cong (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     if(p_scb->co_started)
         p_scb->cong = FALSE;
 }
@@ -2440,6 +2462,7 @@
 void bta_av_rcfg_str_ok (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
     tBTA_AV_RECONFIG    evt;
+    UNUSED(p_data);
 
     p_scb->l2c_cid      = AVDT_GetL2CapChannel(p_scb->avdt_handle);
     APPL_TRACE_DEBUG1("bta_av_rcfg_str_ok: l2c_cid: %d", p_scb->l2c_cid);
@@ -2514,6 +2537,8 @@
 *******************************************************************************/
 void bta_av_rcfg_connect (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     p_scb->cong    = FALSE;
     p_scb->num_recfg++;
     APPL_TRACE_DEBUG1("bta_av_rcfg_connect num_recfg: %d", p_scb->num_recfg);
@@ -2538,6 +2563,7 @@
 void bta_av_rcfg_discntd (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
     tBTA_AV_RECONFIG    evt;
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG1("bta_av_rcfg_discntd num_recfg: %d", p_scb->num_recfg);
     p_scb->num_recfg++;
@@ -2655,6 +2681,8 @@
 *******************************************************************************/
 void bta_av_rcfg_open (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     APPL_TRACE_DEBUG1("bta_av_rcfg_open, num_disc_snks = %d", p_scb->num_disc_snks);
 
     if (p_scb->num_disc_snks == 0)
@@ -2692,6 +2720,8 @@
 *******************************************************************************/
 void bta_av_security_rej (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
+
     AVDT_SecurityRsp(p_scb->avdt_handle, p_scb->avdt_label, AVDT_ERR_BAD_STATE,
                      NULL, 0);
 }
@@ -2711,7 +2741,7 @@
     tBTA_AV_SCB *p_scbi;
     int i;
     BOOLEAN new_started = FALSE;
-
+    UNUSED(p_data);
 
     if ((p_scb->chnl == BTA_AV_CHNL_AUDIO) && (bta_av_cb.audio_open_cnt >= 2))
     {
diff --git a/bta/av/bta_av_act.c b/bta/av/bta_av_act.c
index ada7592..4408874 100755
--- a/bta/av/bta_av_act.c
+++ b/bta/av/bta_av_act.c
@@ -181,6 +181,7 @@
 static void bta_av_avrc_sdp_cback(UINT16 status)
 {
     BT_HDR *p_msg;
+    UNUSED(status);
 
     if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
     {
@@ -202,6 +203,7 @@
 {
     tBTA_AV_RC_CONN_CHG *p_msg;
     UINT16 msg_event = 0;
+    UNUSED(result);
 
 #if (defined(BTA_AV_MIN_DEBUG_TRACES) && BTA_AV_MIN_DEBUG_TRACES == TRUE)
     APPL_TRACE_EVENT2("rc_ctrl handle: %d event=0x%x", handle, event);
@@ -688,6 +690,8 @@
 *******************************************************************************/
 void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_cb);
+
     GKI_freebuf (p_data->api_meta_rsp.p_pkt);
 }
 
@@ -702,6 +706,8 @@
 *******************************************************************************/
 void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_cb);
+    UNUSED(p_data);
 }
 
 
@@ -1362,6 +1368,7 @@
 {
     BT_HDR  hdr;
     UINT16  xx;
+    UNUSED(p_data);
 
     p_cb->disabling = TRUE;
 
@@ -1519,6 +1526,7 @@
     UINT8   mask;
     tBTA_AV_LCB *p_lcb = NULL;
     tBTA_AV_PEND pend;
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG0("bta_av_sig_timer");
     for(xx=0; xx<BTA_AV_NUM_LINKS; xx++)
@@ -1689,6 +1697,7 @@
     tBTA_AV_RC_FEAT rc_feat;
     UINT8               rc_handle;
     tBTA_AV_FEAT        peer_features;  /* peer features mask */
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG1("bta_av_rc_disc_done disc:x%x", p_cb->disc);
     if (!p_cb->disc)
diff --git a/bta/av/bta_av_main.c b/bta/av/bta_av_main.c
index 749756d..25c40a5 100644
--- a/bta/av/bta_av_main.c
+++ b/bta/av/bta_av_main.c
@@ -392,6 +392,7 @@
     tBTA_AV_STR_MSG     *p_msg;
     UINT16  evt = 0;
     tBTA_AV_SCB *p_scb = NULL;
+    UNUSED(handle);
 
 #if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
     if (event == BTA_AR_AVDT_CONN_EVT ||
@@ -450,6 +451,9 @@
 static void bta_av_a2dp_report_cback(UINT8 handle, AVDT_REPORT_TYPE type,
                                     tAVDT_REPORT_DATA *p_data)
 {
+    UNUSED(handle);
+    UNUSED(type);
+    UNUSED(p_data);
     /* Do not need to handle report data for now.
      * This empty function is here for conformance reasons. */
 }
@@ -715,9 +719,9 @@
 **
 *******************************************************************************/
 #if (AVDT_REPORTING == TRUE)
-
 static void bta_av_rpc_conn(tBTA_AV_DATA *p_data)
 {
+    UNUSED(p_data);
 }
 #endif
 
@@ -832,6 +836,7 @@
     tBTA_AV_ROLE_RES  *p_buf;
     UINT8       cur_role;
     UINT8       peer_idx = 0;
+    UNUSED(status);
 
     APPL_TRACE_DEBUG1("bta_av_sys_rs_cback: %d", bta_av_cb.rs_idx);
     for(i=0; i<BTA_AV_NUM_STRS; i++)
@@ -907,6 +912,8 @@
     tBTA_AV_SCB *p_scb;
     int     i;
     tBTA_AV_API_STOP stop;
+    UNUSED(app_id);
+    UNUSED(peer_addr);
 
     APPL_TRACE_DEBUG2("bta_av_sco_chg_cback:%d status:%d", id, status);
     if(id)
@@ -1049,6 +1056,7 @@
     tBTA_AV_SCB *p_scbi;
     int i;
     UINT8   mask;
+    UNUSED(mtu);
 
     /* TODO_MV mess with the mtu according to the number of EDR/non-EDR headsets */
     if(p_scb->chnl == BTA_AV_CHNL_AUDIO)
diff --git a/bta/av/bta_av_sbc.c b/bta/av/bta_av_sbc.c
index 1517270..a570375 100644
--- a/bta/av/bta_av_sbc.c
+++ b/bta/av/bta_av_sbc.c
@@ -26,6 +26,7 @@
 #include "a2d_api.h"
 #include "a2d_sbc.h"
 #include "bta_av_sbc.h"
+#include "utl.h"
 
 typedef int (tBTA_AV_SBC_ACT)(void *p_src, void *p_dst,
                                UINT32 src_samples, UINT32 dst_samples,
@@ -425,6 +426,7 @@
 {
     UINT8           status = A2D_SUCCESS;
     tA2D_SBC_CIE    peer_cie;
+    UNUSED(p_cap);
 
     /* parse peer capabilities */
     if ((status = A2D_ParsSbcInfo(&peer_cie, p_peer, TRUE)) != 0)
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c
index acaca98..b1e7943 100755
--- a/bta/dm/bta_dm_act.c
+++ b/bta/dm/bta_dm_act.c
@@ -250,6 +250,7 @@
 #if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&(BTA_EIR_CANNED_UUID_LIST != TRUE)
 static void bta_dm_app_ready_timer_cback (TIMER_LIST_ENT *p_tle)
 {
+    UNUSED(p_tle);
     bta_dm_set_eir (NULL);
 }
 #else
@@ -457,6 +458,8 @@
 *******************************************************************************/
 void bta_dm_disable (tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
+
     /* Set l2cap idle timeout to 0 (so BTE immediately disconnects ACL link after last channel is closed) */
     L2CA_SetIdleTimeoutByBdAddr((UINT8 *)BT_BD_ANY, 0);
 
@@ -508,7 +511,7 @@
 *******************************************************************************/
 static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
 {
-
+    UNUSED(p_tle);
     UINT8 i;
 
     APPL_TRACE_EVENT0(" bta_dm_disable_timer_cback  ");
@@ -1137,6 +1140,7 @@
 #if (BTM_OOB_INCLUDED == TRUE)
 void bta_dm_loc_oob(tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
     BTM_ReadLocalOobData();
 }
 
@@ -1254,7 +1258,7 @@
 *******************************************************************************/
 void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
 {
-
+    UNUSED(p_data);
     tBTA_DM_MSG * p_msg;
 
     if(BTM_IsInquiryActive())
@@ -2011,6 +2015,7 @@
 *******************************************************************************/
 static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle)
 {
+    UNUSED(p_tle);
 
     APPL_TRACE_EVENT0(" bta_dm_search_timer_cback  ");
     bta_dm_search_cb.wait_disc = FALSE;
@@ -2032,6 +2037,7 @@
 *******************************************************************************/
 void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
     if(bta_dm_search_cb.p_sdp_db)
     {
         GKI_freebuf(bta_dm_search_cb.p_sdp_db);
@@ -2093,7 +2099,7 @@
 *******************************************************************************/
 void bta_dm_search_clear_queue (tBTA_DM_MSG *p_data)
 {
-
+    UNUSED(p_data);
     if(bta_dm_search_cb.p_search_queue)
     {
         GKI_freebuf(bta_dm_search_cb.p_search_queue);
@@ -2114,7 +2120,7 @@
 *******************************************************************************/
 void bta_dm_search_cancel_cmpl (tBTA_DM_MSG *p_data)
 {
-
+    UNUSED(p_data);
     if(bta_dm_search_cb.p_search_queue)
     {
         bta_sys_sendmsg(bta_dm_search_cb.p_search_queue);
@@ -2135,7 +2141,7 @@
 *******************************************************************************/
 void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data)
 {
-
+    UNUSED(p_data);
     if(bta_dm_search_cb.p_sdp_db)
     {
         GKI_freebuf(bta_dm_search_cb.p_sdp_db);
@@ -2157,6 +2163,7 @@
 *******************************************************************************/
 void bta_dm_search_cancel_notify (tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
     if (bta_dm_search_cb.p_search_cback)
     {
         bta_dm_search_cb.p_search_cback(BTA_DM_SEARCH_CANCEL_CMPL_EVT, NULL);
@@ -2617,6 +2624,7 @@
 {
     tBTM_REMOTE_DEV_NAME    rem_name;
     tBTM_STATUS             btm_status;
+    UNUSED(dc);
 
     APPL_TRACE_DEBUG1("bta_dm_service_search_remname_cback name=<%s>", bd_name);
 
@@ -2712,6 +2720,8 @@
 {
     tBTA_DM_SEC sec_event;
     UINT8       index = 1;
+    UNUSED(service_name);
+    UNUSED(is_originator);
 
     bdcpy(sec_event.authorize.bd_addr, bd_addr);
     memcpy(sec_event.authorize.dev_class, dev_class, DEV_CLASS_LEN);
@@ -2876,6 +2886,8 @@
     API. If BTM doesn't have the link key in it's
     data base, that's because application doesn't
     it */
+    UNUSED(bd_addr);
+    UNUSED(key);
 
     return BTM_NOT_AUTHORIZED;
 }
@@ -2899,6 +2911,7 @@
     tBTA_DM_SEC sec_event;
     tBTA_DM_AUTH_CMPL *p_auth_cmpl;
     UINT8             event;
+    UNUSED(dev_class);
 
     memset (&sec_event, 0, sizeof(tBTA_DM_SEC));
 
@@ -2945,8 +2958,8 @@
 *******************************************************************************/
 static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result)
 {
-
     tBTA_DM_SEC sec_event;
+    UNUSED(dev_class);
 
     if(result != BTM_SUCCESS)
     {
@@ -3111,6 +3124,7 @@
 static void bta_dm_local_name_cback(UINT8 *p_name)
 {
     tBTA_DM_SEC sec_event;
+    UNUSED(p_name);
 
     BTM_GetLocalDeviceAddr(sec_event.enable.bd_addr);
     sec_event.enable.status = BTA_SUCCESS;
@@ -3156,7 +3170,7 @@
 *******************************************************************************/
 static void bta_dm_signal_strength_timer_cback (TIMER_LIST_ENT *p_tle)
 {
-
+    UNUSED(p_tle);
     UINT8 i;
 
     if(bta_dm_cb.signal_strength_mask & BTA_SIG_STRENGTH_RSSI_MASK)
@@ -3282,6 +3296,7 @@
 *******************************************************************************/
 static void bta_dm_rs_cback (tBTM_ROLE_SWITCH_CMPL *p1)
 {
+    UNUSED(p1);
     APPL_TRACE_WARNING1("bta_dm_rs_cback:%d", bta_dm_cb.rs_event);
     if(bta_dm_cb.rs_event == BTA_DM_API_SEARCH_EVT)
     {
@@ -3550,6 +3565,7 @@
 *******************************************************************************/
 static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle)
 {
+    UNUSED(p_tle);
     tBTA_SYS_HW_MSG *sys_enable_event;
 
     /* disable the power managment module */
@@ -3747,6 +3763,7 @@
 *******************************************************************************/
 static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle)
 {
+    UNUSED(p_tle);
     APPL_TRACE_EVENT0("bta_dm_delay_role_switch_cback: initiating Delayed RS");
     bta_dm_adjust_roles (FALSE);
 }
@@ -4439,6 +4456,7 @@
 *******************************************************************************/
 void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
     BTM_EnableTestMode();
 }
 
@@ -4454,6 +4472,7 @@
 *******************************************************************************/
 void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
     BTM_DeviceReset(NULL);
 }
 
@@ -4490,6 +4509,7 @@
 {
     tBTA_STATUS   bta_status = BTA_SUCCESS;
     tBTA_DM_ENCRYPT_CBACK *p_callback = bta_dm_cb.p_encrypt_cback;
+    UNUSED(p_ref_data);
 
     bta_dm_cb.p_encrypt_cback = NULL;
     switch (result)
@@ -5256,6 +5276,8 @@
 *******************************************************************************/
 void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data)
 {
+    UNUSED(p_data);
+
     if (bta_dm_search_cb.conn_id != BTA_GATT_INVALID_CONN_ID)
         BTA_GATTC_Close(bta_dm_search_cb.conn_id);
 
diff --git a/bta/dm/bta_dm_api.c b/bta/dm/bta_dm_api.c
index e37548e..1fbe7c7 100644
--- a/bta/dm/bta_dm_api.c
+++ b/bta/dm/bta_dm_api.c
@@ -31,6 +31,7 @@
 #include "btm_api.h"
 #include "btm_int.h"
 #include <string.h>
+#include "utl.h"
 
 /*****************************************************************************
 **  Constants
@@ -207,7 +208,7 @@
     {
         p_msg->hdr.event = BTA_DM_API_SET_NAME_EVT;
         /* truncate the name if needed */
-        BCM_STRNCPY_S(p_msg->name, sizeof(p_msg->name), p_name, BD_NAME_LEN-1);
+        BCM_STRNCPY_S((char *)p_msg->name, sizeof(p_msg->name), p_name, BD_NAME_LEN-1);
         p_msg->name[BD_NAME_LEN-1]=0;
 
         bta_sys_sendmsg(p_msg);
@@ -1715,8 +1716,8 @@
 *******************************************************************************/
 void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable)
 {
-#if BLE_INCLUDED == TRUE
-#endif
+    UNUSED(bd_addr);
+    UNUSED(privacy_enable);
 }
 
 
@@ -1733,8 +1734,7 @@
 *******************************************************************************/
 void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable)
 {
-#if BLE_INCLUDED == TRUE
-#endif
+    UNUSED(privacy_enable);
 }
 
 
diff --git a/bta/gatt/bta_gattc_act.c b/bta/gatt/bta_gattc_act.c
index 444c357..bc23d5d 100644
--- a/bta/gatt/bta_gattc_act.c
+++ b/bta/gatt/bta_gattc_act.c
@@ -250,6 +250,8 @@
 *******************************************************************************/
 void bta_gattc_start_if(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg)
 {
+    UNUSED(p_cb);
+
     if (bta_gattc_cl_get_regcb(p_msg->int_start_if.client_if) !=NULL )
     {
         GATT_StartIf(p_msg->int_start_if.client_if);
@@ -329,6 +331,7 @@
     UINT16 event = ((BT_HDR *)p_msg)->event;
     tBTA_GATTC_CLCB *p_clcb = NULL;
     tBTA_GATTC_RCB *p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if);
+    UNUSED(p_cb);
 
     if (p_clreg != NULL)
     {
@@ -375,6 +378,7 @@
     tBTA_GATTC_CLCB *p_clcb = NULL;
     tBTA_GATTC_RCB *p_clreg;
     tBTA_GATTC cb_data;
+    UNUSED(p_cb);
 
     if (p_msg->api_cancel_conn.is_direct)
     {
@@ -416,6 +420,7 @@
 {
     tBTA_GATTC_RCB *p_clreg;
     tBTA_GATTC cb_data;
+    UNUSED(p_cb);
 
     p_clreg = bta_gattc_cl_get_regcb(p_msg->enc_cmpl.client_if);
 
@@ -442,6 +447,8 @@
 void bta_gattc_cancel_open_error(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
     tBTA_GATTC cb_data;
+    UNUSED(p_data);
+
     cb_data.status=BTA_GATT_ERROR;
 
     if ( p_clcb && p_clcb->p_rcb && p_clcb->p_rcb->p_cback )
@@ -459,6 +466,8 @@
 *******************************************************************************/
 void bta_gattc_open_error(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     APPL_TRACE_ERROR0("Connection already opened. wrong state");
 
     bta_gattc_send_open_cback(p_clcb->p_rcb,
@@ -477,6 +486,8 @@
 *******************************************************************************/
 void bta_gattc_open_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     bta_gattc_send_open_cback(p_clcb->p_rcb,
                               BTA_GATT_ERROR,
                               p_clcb->bda,
@@ -618,6 +629,7 @@
 void bta_gattc_cancel_open_ok(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
     tBTA_GATTC          cb_data;
+    UNUSED(p_data);
 
     if ( p_clcb->p_rcb->p_cback )
     {
@@ -854,6 +866,8 @@
 *******************************************************************************/
 void bta_gattc_restart_discover(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     p_clcb->status      = BTA_GATT_CANCEL;
     p_clcb->auto_update = BTA_GATTC_DISC_WAITING;
 }
@@ -868,6 +882,7 @@
 *******************************************************************************/
 void bta_gattc_start_discover(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
 
     APPL_TRACE_DEBUG2("bta_gattc_start_discover conn_id=%d p_clcb->p_srcb->state = %d ",
         p_clcb->bta_conn_id, p_clcb->p_srcb->state);
@@ -926,6 +941,8 @@
 void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
     tBTA_GATTC_DATA *p_q_cmd = p_clcb->p_q_cmd;
+    UNUSED(p_data);
+
     APPL_TRACE_DEBUG1("bta_gattc_disc_cmpl conn_id=%d",p_clcb->bta_conn_id);
 
 #if BLE_INCLUDED == TRUE
@@ -1404,6 +1421,8 @@
 *******************************************************************************/
 void  bta_gattc_ignore_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_clcb);
+
     /* receive op complete when discovery is started, ignore the response,
         and wait for discovery finish and resent */
     APPL_TRACE_DEBUG1("bta_gattc_ignore_op_cmpl op = %d", p_data->hdr.layer_specific);
@@ -1460,6 +1479,8 @@
 *******************************************************************************/
 void bta_gattc_cache_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     bta_gattc_set_discover_st(p_clcb->p_srcb);
 
     APPL_TRACE_DEBUG1("bta_gattc_cache_open conn_id=%d",p_clcb->bta_conn_id);
@@ -1571,6 +1592,8 @@
 *******************************************************************************/
 void bta_gattc_ci_save(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     APPL_TRACE_DEBUG1("bta_gattc_ci_save conn_id=%d  " ,
                       p_clcb->bta_conn_id   );
 
@@ -1592,6 +1615,8 @@
 *******************************************************************************/
 void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 {
+    UNUSED(p_data);
+
     if (p_clcb->status == BTA_GATT_OK)
     {
         APPL_TRACE_ERROR1("operation not supported at current state [%d]", p_clcb->state);
@@ -1724,6 +1749,7 @@
     tBTA_GATTC_CLCB      *p_clcb = &bta_gattc_cb.clcb[0];
     BOOLEAN         found = FALSE;
     UINT8           i;
+    UNUSED(p_cb);
 
     if (p_srvc_cb != NULL)
     {
@@ -2074,6 +2100,8 @@
 {
     tBTA_GATTC_RCB      *p_clreg = bta_gattc_cl_get_regcb(p_msg->api_listen.client_if);
     tBTA_GATTC          cb_data;
+    UNUSED(p_cb);
+
     cb_data.reg_oper.status = BTA_GATT_ERROR;
     cb_data.reg_oper.client_if = p_msg->api_listen.client_if;
 
diff --git a/bta/gatt/bta_gattc_cache.c b/bta/gatt/bta_gattc_cache.c
index bc784d7..1836d38 100644
--- a/bta/gatt/bta_gattc_cache.c
+++ b/bta/gatt/bta_gattc_cache.c
@@ -689,6 +689,7 @@
     tBTA_GATTC_ATTR_REC *p_rec = NULL;
     UINT8   i;
     BOOLEAN exist_srvc = FALSE;
+    UNUSED(uuid);
 
     if (!GATT_HANDLE_IS_VALID(s_handle) || !GATT_HANDLE_IS_VALID(e_handle))
     {
diff --git a/bta/gatt/bta_gattc_ci.c b/bta/gatt/bta_gattc_ci.c
index 212126f..533955a 100644
--- a/bta/gatt/bta_gattc_ci.c
+++ b/bta/gatt/bta_gattc_ci.c
@@ -33,6 +33,7 @@
 #include "bta_gattc_ci.h"
 #include "gki.h"
 #include "bd.h"
+#include "utl.h"
 
 /*******************************************************************************
 **
@@ -52,6 +53,7 @@
                              UINT16 conn_id)
 {
     tBTA_GATTC_CI_EVT  *p_evt;
+    UNUSED(server_bda);
 
     if ((p_evt = (tBTA_GATTC_CI_EVT *) GKI_getbuf(sizeof(tBTA_GATTC_CI_EVT))) != NULL)
     {
@@ -84,6 +86,7 @@
                              UINT16 conn_id)
 {
     tBTA_GATTC_CI_LOAD  *p_evt;
+    UNUSED(server_bda);
 
     if ((p_evt = (tBTA_GATTC_CI_LOAD *) GKI_getbuf(sizeof(tBTA_GATTC_CI_LOAD))) != NULL)
     {
@@ -124,6 +127,7 @@
                              UINT16 conn_id)
 {
     tBTA_GATTC_CI_EVT  *p_evt;
+    UNUSED(server_bda);
 
     if ((p_evt = (tBTA_GATTC_CI_EVT *) GKI_getbuf(sizeof(tBTA_GATTC_CI_EVT))) != NULL)
     {
diff --git a/bta/gatt/bta_gatts_act.c b/bta/gatt/bta_gatts_act.c
index f1bd88e..be03655 100644
--- a/bta/gatt/bta_gatts_act.c
+++ b/bta/gatt/bta_gatts_act.c
@@ -267,6 +267,8 @@
 *******************************************************************************/
 void bta_gatts_start_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg)
 {
+    UNUSED(p_cb);
+
     if (bta_gatts_find_app_rcb_by_app_if(p_msg->int_start_if.server_if))
     {
         GATT_StartIf(p_msg->int_start_if.server_if);
@@ -577,6 +579,7 @@
 {
     tBTA_GATTS_RCB *p_rcb = &bta_gatts_cb.rcb[p_srvc_cb->rcb_idx];
     tBTA_GATTS      cb_data;
+    UNUSED(p_msg);
 
     GATTS_StopService(p_srvc_cb->service_id);
     cb_data.srvc_oper.server_if = p_rcb->gatt_if;
@@ -599,6 +602,7 @@
 *******************************************************************************/
 void bta_gatts_send_rsp (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg)
 {
+    UNUSED(p_cb);
 
     if (GATTS_SendRsp (p_msg->api_rsp.hdr.layer_specific,
                         p_msg->api_rsp.trans_id,
@@ -688,7 +692,7 @@
 {
     tBTA_GATTS_RCB      *p_rcb=NULL;
     tBTA_GATT_STATUS    status= BTA_GATT_ERROR;
-
+    UNUSED(p_cb);
 
     if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_open.server_if)) != NULL)
     {
@@ -719,6 +723,7 @@
 {
     tBTA_GATTS_RCB      *p_rcb;
     tBTA_GATT_STATUS    status= BTA_GATT_ERROR;
+    UNUSED(p_cb);
 
     if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_cancel_open.server_if)) != NULL)
     {
@@ -754,6 +759,7 @@
     tBTA_GATT_STATUS    status= BTA_GATT_ERROR;
     tGATT_IF            gatt_if;
     BD_ADDR             remote_bda;
+    UNUSED(p_cb);
 
     if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda))
     {
@@ -795,6 +801,8 @@
 {
     tBTA_GATTS_RCB     *p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_listen.server_if);
     tBTA_GATTS          cb_data;
+    UNUSED(p_cb);
+
     cb_data.reg_oper.status = BTA_GATT_OK;
     cb_data.reg_oper.server_if = p_msg->api_listen.server_if;
 
diff --git a/bta/hh/bta_hh_act.c b/bta/hh/bta_hh_act.c
index 19f6b0c..8ec2698 100644
--- a/bta/hh/bta_hh_act.c
+++ b/bta/hh/bta_hh_act.c
@@ -33,6 +33,7 @@
 #include "l2c_api.h"
 #include "bta_hh_int.h"
 #include "bta_hh_co.h"
+#include "utl.h"
 
 /*****************************************************************************
 **  Constants
@@ -944,6 +945,8 @@
 *******************************************************************************/
 void bta_hh_get_dscp_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
 {
+    UNUSED(p_data);
+
 #if (BTA_HH_LE_INCLUDED == TRUE)
     if (p_cb->is_le_device)
     {
diff --git a/bta/hh/bta_hh_api.c b/bta/hh/bta_hh_api.c
index 1e71d91..df41a52 100644
--- a/bta/hh/bta_hh_api.c
+++ b/bta/hh/bta_hh_api.c
@@ -33,6 +33,7 @@
 #include "bta_hh_api.h"
 #include "bta_hh_int.h"
 #include "l2c_api.h"
+#include "utl.h"
 
 /*****************************************************************************
 **  Constants
@@ -305,12 +306,13 @@
 *******************************************************************************/
 void BTA_HhSendData(UINT8 dev_handle, BD_ADDR dev_bda, BT_HDR  *p_data)
 {
+    UNUSED(dev_bda);
 #if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
-        if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT)
-        {
-            APPL_TRACE_ERROR0("ERROR! Wrong report type! Write Command only valid for output report!");
-            return;
-        }
+    if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT)
+    {
+        APPL_TRACE_ERROR0("ERROR! Wrong report type! Write Command only valid for output report!");
+        return;
+    }
 #endif
     bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA, (UINT8)p_data->layer_specific, 0, 0, p_data);
 }
diff --git a/bta/hh/bta_hh_le.c b/bta/hh/bta_hh_le.c
index dbbfb32..4f297ee 100644
--- a/bta/hh/bta_hh_le.c
+++ b/bta/hh/bta_hh_le.c
@@ -29,6 +29,7 @@
 #include "bta_gatt_api.h"
 #include "srvc_api.h"
 #include "btm_int.h"
+#include "utl.h"
 
 #ifndef BTA_HH_LE_RECONN
 #define BTA_HH_LE_RECONN    TRUE
@@ -1213,6 +1214,7 @@
 {
     UINT8   idx = bta_hh_find_cb(bd_addr);
     tBTA_HH_DEV_CB *p_dev_cb;
+    UNUSED(p_ref_data);
 
     APPL_TRACE_ERROR0("bta_hh_le_encrypt_cback");
 
@@ -1239,6 +1241,8 @@
 *******************************************************************************/
 void bta_hh_security_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
 {
+    UNUSED(p_buf);
+
     if (p_cb->status == BTA_HH_OK)
     {
         /*  discovery has been done for HID service */
@@ -1296,6 +1300,7 @@
 {
     UINT8           sec_flag=0;
     tBTM_SEC_DEV_REC  *p_dev_rec;
+    UNUSED(p_buf);
 
     p_dev_rec = btm_find_dev(p_cb->addr);
     if (p_dev_rec)
@@ -1640,6 +1645,9 @@
 *******************************************************************************/
 void bta_hh_read_battery_level_cmpl(UINT8 status, tBTA_HH_DEV_CB *p_dev_cb, tBTA_GATTC_READ *p_data)
 {
+    UNUSED(status);
+    UNUSED(p_data);
+
     p_dev_cb->hid_srvc[p_dev_cb->cur_srvc_index].expl_incl_srvc = TRUE;
     bta_hh_le_srvc_expl_srvc(p_dev_cb);
 }
diff --git a/bta/hl/bta_hl_act.c b/bta/hl/bta_hl_act.c
index 8e16146..01528aa 100644
--- a/bta/hl/bta_hl_act.c
+++ b/bta/hl/bta_hl_act.c
@@ -121,6 +121,7 @@
     tBTA_HL_APP_CB      *p_acb  = BTA_HL_GET_APP_CB_PTR(app_idx);
     tBTA_HL_MCL_CB      *p_mcb  = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
     tBTA_HL_MDL_CB      *p_dcb  = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
+    UNUSED(p_data);
 
 #if (BTA_HL_DEBUG == TRUE)
     APPL_TRACE_DEBUG0("bta_hl_dch_echo_test");
diff --git a/bta/hl/bta_hl_main.c b/bta/hl/bta_hl_main.c
index 8a53df7..7b15585 100644
--- a/bta/hl/bta_hl_main.c
+++ b/bta/hl/bta_hl_main.c
@@ -770,9 +770,9 @@
 *******************************************************************************/
 static void bta_hl_api_deregister(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
 {
-
     UINT8           app_idx;
     tBTA_HL_APP_CB  *p_acb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_app_idx_using_handle(p_data->api_dereg.app_handle, &app_idx))
     {
@@ -802,6 +802,7 @@
     UINT8           app_idx, mcl_idx;
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_app_idx_using_handle(p_data->api_cch_open.app_handle, &app_idx))
     {
@@ -900,6 +901,7 @@
     UINT8           app_idx, mcl_idx;
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_cch_close.mcl_handle, &app_idx,  &mcl_idx))
     {
@@ -961,10 +963,11 @@
     tBTA_HL_STATUS              status = BTA_HL_STATUS_OK;
     UINT8                       app_idx, mcl_idx, mdl_idx;
     tBTA_HL_APP_CB              *p_acb;
-    tBTA_HL_MCL_CB              *p_mcb;
+    tBTA_HL_MCL_CB              *p_mcb = NULL;
     tBTA_HL_MDL_CB              *p_dcb;
     tBTA_HL_MDEP_CFG            *p_mdep_cfg;
     UINT8                       mdep_cfg_idx;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_open.mcl_handle, &app_idx, &mcl_idx))
     {
@@ -1116,7 +1119,7 @@
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
     tBTA_HL_MDL_CB  *p_dcb;
-
+    UNUSED(p_cb);
 
     if (bta_hl_find_mdl_idx_using_handle(p_data->api_dch_close.mdl_handle, &app_idx, &mcl_idx, &mdl_idx ))
     {
@@ -1183,11 +1186,12 @@
     tBTA_HL_STATUS  status = BTA_HL_STATUS_OK;
     UINT8           app_idx, mcl_idx, mdl_idx;
     tBTA_HL_APP_CB  *p_acb;
-    tBTA_HL_MCL_CB  *p_mcb;
+    tBTA_HL_MCL_CB  *p_mcb = NULL;
     tBTA_HL_MDL_CB  *p_dcb;
     UINT8           mdep_cfg_idx;
     UINT8           mdl_cfg_idx;
     tBTA_HL_MDEP_CFG            *p_mdep_cfg;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_reconnect.mcl_handle, &app_idx, &mcl_idx))
     {
@@ -1323,10 +1327,10 @@
     tBTA_HL_STATUS      status = BTA_HL_STATUS_OK;
     UINT8               app_idx, mcl_idx, mdl_idx;
     tBTA_HL_APP_CB      *p_acb;
-    tBTA_HL_MCL_CB      *p_mcb;
+    tBTA_HL_MCL_CB      *p_mcb = NULL;
     tBTA_HL_MDL_CB      *p_dcb;
     tBTA_HL_ECHO_CFG    *p_echo_cfg;
-
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_echo_test.mcl_handle, &app_idx,  &mcl_idx))
     {
@@ -1457,7 +1461,7 @@
     UINT8           app_idx, mcl_idx;
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
-
+    UNUSED(p_cb);
 
     if (bta_hl_find_app_idx_using_handle(p_data->api_sdp_query.app_handle, &app_idx))
     {
@@ -1564,6 +1568,7 @@
     tBTA_HL_SDP_OPER    sdp_oper;
     UINT16              event;
     BOOLEAN             release_sdp_buf=FALSE;
+    UNUSED(p_cb);
 
     event = p_data->hdr.event;
     sdp_oper = p_mcb->sdp_oper;
@@ -1638,6 +1643,7 @@
     UINT8           app_idx, mcl_idx;
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_delete_mdl.mcl_handle, &app_idx, &mcl_idx ))
     {
@@ -1728,6 +1734,7 @@
     tBTA_HL_MCL_CB  *p_mcb;
     BOOLEAN         send_cfm_evt = TRUE;
     tBTA_HL_APP_CB  *p_acb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->mca_evt.mcl_handle, &app_idx, &mcl_idx))
     {
@@ -1807,6 +1814,7 @@
     tBTA_HL_MDL_CB  *p_dcb;
     BOOLEAN         send_ind_evt = FALSE;
     tBTA_HL_APP_CB  *p_acb;
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->mca_evt.mcl_handle, &app_idx, &mcl_idx) )
     {
@@ -1862,14 +1870,13 @@
 *******************************************************************************/
 static void bta_hl_api_dch_abort(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
 {
-
     tBTA_HL_STATUS  status = BTA_HL_STATUS_OK;
     UINT8           app_idx, mcl_idx, mdl_idx;
     tBTA_HL_APP_CB  *p_acb;
     tBTA_HL_MCL_CB  *p_mcb;
     tBTA_HL_MDL_CB  *p_dcb;
     tBTA_HL         evt_data;
-
+    UNUSED(p_cb);
 
     if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_abort.mcl_handle, &app_idx, &mcl_idx ))
     {
diff --git a/bta/hl/bta_hl_sdp.c b/bta/hl/bta_hl_sdp.c
index 22dd70a..43d22d2 100644
--- a/bta/hl/bta_hl_sdp.c
+++ b/bta/hl/bta_hl_sdp.c
@@ -23,7 +23,7 @@
 
 #include "sdp_api.h"
 #include "bta_hl_int.h"
-
+#include "utl.h"
 
 /*******************************************************************************
 **
@@ -164,11 +164,7 @@
 **
 **  Purpose:     Register an HDP application with SDP
 **
-**  Parameters:  p_cb           - Pointer to MA instance control block
-**               p_service_name - MA server name
-**               inst_id        - MAS instance ID
-**               msg_type       - Supported message type(s)
-**
+**  Parameters:
 **
 **  Returns:     void
 **
@@ -189,6 +185,7 @@
     tBTA_HL_APP_CB                  *p_cb = BTA_HL_GET_APP_CB_PTR(0);
     BOOLEAN                         result = TRUE;
     tBTA_HL_STATUS                  status = BTA_HL_STATUS_OK;
+    UNUSED(app_id);
 
     if ((p_cb->sup_feature.app_role_mask == BTA_HL_MDEP_ROLE_MASK_SOURCE) &&
         (!p_cb->sup_feature.advertize_source_sdp))
diff --git a/bta/hl/bta_hl_utils.c b/bta/hl/bta_hl_utils.c
index 2fc6a6f..6a08b74 100644
--- a/bta/hl/bta_hl_utils.c
+++ b/bta/hl/bta_hl_utils.c
@@ -53,6 +53,7 @@
 {
     tBTA_HL_MCL_CB *p_mcb  = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
     BOOLEAN success = TRUE, update_ctrl_psm = FALSE;
+    UNUSED(mdl_idx);
 
     if (p_mcb->sdp.num_recs)
     {
@@ -1353,7 +1354,7 @@
 **
 ** Function      bta_hl_find_mdl_cfg_idx
 **
-** Description  This function finds an available MDL configiration index
+** Description  This function finds an available MDL configuration index
 **
 ** Returns      BOOLEAN - TRUE found
 **                        FALSE not found
@@ -1367,7 +1368,7 @@
     BOOLEAN             found=FALSE;
     UINT8               first_mdl_cfg_idx, second_mdl_cfg_idx, older_mdl_cfg_idx;
     BOOLEAN             done;
-
+    UNUSED(mcl_idx);
 
     for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
     {
diff --git a/bta/jv/bta_jv_act.c b/bta/jv/bta_jv_act.c
index ea2d4ff..77f636b 100644
--- a/bta/jv/bta_jv_act.c
+++ b/bta/jv/bta_jv_act.c
@@ -379,6 +379,7 @@
 *******************************************************************************/
 tBTA_JV_STATUS bta_jv_free_l2c_cb(tBTA_JV_L2C_CB *p_cb)
 {
+    UNUSED(p_cb);
 #if 0
     tBTA_JV_STATUS status = BTA_JV_SUCCESS;
 
@@ -733,6 +734,8 @@
 *******************************************************************************/
 void bta_jv_disable (tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
+
     APPL_TRACE_ERROR0("bta_jv_disable not used");
 #if 0
     int i;
@@ -823,6 +826,8 @@
 *******************************************************************************/
 void bta_jv_get_local_device_addr(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
+
     BTM_ReadLocalDeviceAddr((tBTM_CMPL_CB *)bta_jv_get_local_device_addr_cback);
 }
 
@@ -839,6 +844,7 @@
 {
     tBTA_JV evt_data;
     char *name;
+    UNUSED(p_data);
 
     BTM_ReadLocalDeviceName(&name);
     evt_data.p_name = (UINT8*)name;
@@ -896,6 +902,8 @@
 *******************************************************************************/
 static void bta_jv_sec_cback (BD_ADDR bd_addr, void *p_ref_data, tBTM_STATUS result)
 {
+    UNUSED(p_ref_data);
+
     tBTA_JV_SET_ENCRYPTION  set_enc;
     if(bta_jv_cb.p_dm_cback)
     {
@@ -932,6 +940,7 @@
 *******************************************************************************/
 void bta_jv_get_scn(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     UINT8   scn;
     scn = BTM_AllocateSCN();
@@ -1144,6 +1153,7 @@
 *******************************************************************************/
 void bta_jv_get_services_length(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_SERVICES_LEN    evt_data;
     UINT8   *p, *np, *op, type;
@@ -1201,6 +1211,7 @@
 *******************************************************************************/
 void bta_jv_service_select(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_SERVICE_SEL     serv_sel;
     tSDP_DISC_REC *p_rec, *p_tmp;
@@ -1283,6 +1294,7 @@
 *******************************************************************************/
 void bta_jv_update_record(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_API_UPDATE_RECORD *ur = &(p_data->update_record);
     tBTA_JV_UPDATE_RECORD   evt_data;
@@ -1346,6 +1358,7 @@
 *******************************************************************************/
 void bta_jv_add_attribute(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_API_ADD_ATTRIBUTE *aa = &(p_data->add_attr);
     tBTA_JV_ADD_ATTR   evt_data;
@@ -1392,6 +1405,7 @@
 *******************************************************************************/
 void bta_jv_delete_attribute(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_API_ADD_ATTRIBUTE *da = &(p_data->add_attr);
     tBTA_JV_DELETE_ATTR   evt_data;
@@ -1444,6 +1458,8 @@
 *******************************************************************************/
 static void bta_jv_l2cap_client_cback(UINT16 gap_handle, UINT16 event)
 {
+    UNUSED(gap_handle);
+    UNUSED(event);
 #if 0
     tBTA_JV_L2C_CB  *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
     tBTA_JV     evt_data;
@@ -1573,6 +1589,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_connect(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2C_CB      *p_cb;
     tBTA_JV_L2CAP_CL_INIT  evt_data;
@@ -1648,6 +1665,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_close(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2CAP_CLOSE  evt_data;
     tBTA_JV_API_L2CAP_CLOSE *cc = &(p_data->l2cap_close);
@@ -1675,6 +1693,8 @@
 *******************************************************************************/
 static void bta_jv_l2cap_server_cback(UINT16 gap_handle, UINT16 event)
 {
+    UNUSED(gap_handle);
+    UNUSED(event);
 #if 0
     tBTA_JV_L2C_CB  *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
     tBTA_JV evt_data;
@@ -1734,6 +1754,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_start_server(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2C_CB      *p_cb;
     UINT8   sec_id;
@@ -1800,6 +1821,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_stop_server(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2C_CB      *p_cb;
     tBTA_JV_L2CAP_CLOSE  evt_data;
@@ -1834,6 +1856,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_read(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2CAP_READ evt_data;
     tBTA_JV_API_L2CAP_READ *rc = &(p_data->l2cap_read);
@@ -1877,6 +1900,7 @@
 *******************************************************************************/
 void bta_jv_l2cap_write(tBTA_JV_MSG *p_data)
 {
+    UNUSED(p_data);
 #if 0
     tBTA_JV_L2CAP_WRITE evt_data;
     tBTA_JV_API_L2CAP_WRITE *ls = &(p_data->l2cap_write);
diff --git a/bta/jv/bta_jv_api.c b/bta/jv/bta_jv_api.c
index 1ee9924..16ab2d5 100644
--- a/bta/jv/bta_jv_api.c
+++ b/bta/jv/bta_jv_api.c
@@ -31,6 +31,7 @@
 #include <string.h>
 #include "port_api.h"
 #include "sdp_api.h"
+#include "utl.h"
 
 /*****************************************************************************
 **  Constants
@@ -714,6 +715,8 @@
 *******************************************************************************/
 INT32 BTA_JvGetServicesResult(BOOLEAN inc_hdr, UINT8 **TLVs)
 {
+    UNUSED(inc_hdr);
+    UNUSED(TLVs);
 #if 0
     INT32 num_services = -1;
     UINT8   *p, *np, *op, type;
@@ -860,6 +863,11 @@
 tBTA_JV_STATUS BTA_JvUpdateRecord(UINT32 handle, UINT16 *p_ids,
     UINT8 **p_values, INT32 *p_value_sizes, INT32 array_len)
 {
+    UNUSED(handle);
+    UNUSED(p_ids);
+    UNUSED(p_values);
+    UNUSED(p_value_sizes);
+    UNUSED(array_len);
 #if 0
     tBTA_JV_STATUS status = BTA_JV_FAILURE;
     tBTA_JV_API_UPDATE_RECORD *p_msg;
@@ -1145,6 +1153,11 @@
 *******************************************************************************/
 tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
 {
+    UNUSED(handle);
+    UNUSED(req_id);
+    UNUSED(p_data);
+    UNUSED(len);
+
 #if 0
     tBTA_JV_STATUS status = BTA_JV_FAILURE;
 #if SDP_FOR_JV_INCLUDED == TRUE
@@ -1208,6 +1221,10 @@
 *******************************************************************************/
 tBTA_JV_STATUS BTA_JvL2capReceive(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
 {
+    UNUSED(handle);
+    UNUSED(req_id);
+    UNUSED(p_data);
+    UNUSED(len);
 #if 0
     tBTA_JV_STATUS status = BTA_JV_FAILURE;
     tBTA_JV_L2CAP_RECEIVE evt_data;
@@ -1256,6 +1273,8 @@
 *******************************************************************************/
 tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size)
 {
+    UNUSED(handle);
+    UNUSED(p_data_size);
 #if 0
     tBTA_JV_STATUS status = BTA_JV_FAILURE;
 
diff --git a/bta/pan/bta_pan_act.c b/bta/pan/bta_pan_act.c
index b29920f..b01e95a 100644
--- a/bta/pan/bta_pan_act.c
+++ b/bta/pan/bta_pan_act.c
@@ -35,6 +35,7 @@
 #include "bta_pan_int.h"
 #include "bta_pan_co.h"
 #include <string.h>
+#include "utl.h"
 
 
 /* RX and TX data flow mask */
@@ -476,6 +477,7 @@
 void bta_pan_api_close (tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
 {
     tBTA_PAN_CONN * p_buf;
+    UNUSED(p_data);
 
     PAN_Disconnect (p_scb->handle);
 
@@ -586,6 +588,8 @@
 *******************************************************************************/
 void bta_pan_rx_path(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
 {
+    UNUSED(p_data);
+
     /* if data path configured for rx pull */
     if ((bta_pan_cb.flow_mask & BTA_PAN_RX_MASK) == BTA_PAN_RX_PULL)
     {
@@ -615,8 +619,9 @@
 *******************************************************************************/
 void bta_pan_tx_path(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
 {
-
     BT_HDR * p_buf;
+    UNUSED(p_data);
+
     /* if data path configured for tx pull */
     if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PULL)
     {
@@ -720,6 +725,7 @@
 *******************************************************************************/
 void bta_pan_free_buf(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
 {
+    UNUSED(p_scb);
 
     GKI_freebuf(p_data);
 
diff --git a/bta/pan/bta_pan_main.c b/bta/pan/bta_pan_main.c
index add1c7c..5ed545f 100644
--- a/bta/pan/bta_pan_main.c
+++ b/bta/pan/bta_pan_main.c
@@ -34,6 +34,7 @@
 #include "bta_pan_api.h"
 #include "bta_pan_int.h"
 #include "bd.h"
+#include "utl.h"
 
 /*****************************************************************************
 ** Constants and types
@@ -265,6 +266,8 @@
 *******************************************************************************/
 static void bta_pan_api_disable(tBTA_PAN_DATA *p_data)
 {
+    UNUSED(p_data);
+
     bta_pan_disable();
 }
 
diff --git a/bta/sys/bta_sys_conn.c b/bta/sys/bta_sys_conn.c
index b495085..a5d1017 100644
--- a/bta/sys/bta_sys_conn.c
+++ b/bta/sys/bta_sys_conn.c
@@ -26,7 +26,7 @@
 #include "bta_sys.h"
 #include "bta_sys_int.h"
 #include "gki.h"
-
+#include "utl.h"
 
 /*******************************************************************************
 **
@@ -349,6 +349,8 @@
 *******************************************************************************/
 void bta_sys_sco_use(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
 {
+    UNUSED(id);
+
     /* AV streaming need to be suspended before SCO is connected. */
     if(bta_sys_cb.p_sco_cb)
     {
@@ -370,6 +372,7 @@
 void bta_sys_sco_unuse(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
 {
     UINT8 num_sco_links;
+    UNUSED(id);
 
     if((bta_sys_cb.p_sco_cb))
     {
diff --git a/bta/sys/bta_sys_main.c b/bta/sys/bta_sys_main.c
index 59fbdd7..a440f52 100644
--- a/bta/sys/bta_sys_main.c
+++ b/bta/sys/bta_sys_main.c
@@ -44,6 +44,7 @@
 #if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
 #include "bta_ar_api.h"
 #endif
+#include "utl.h"
 
 /* protocol timer update period, in milliseconds */
 #ifndef BTA_SYS_TIMER_PERIOD
@@ -295,8 +296,8 @@
 *******************************************************************************/
 void bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg)
 {
-
     UINT8 module_index;
+    UNUSED(p_sys_hw_msg);
 
     APPL_TRACE_DEBUG1("%s", __FUNCTION__);
 
@@ -455,7 +456,7 @@
 **
 ** Function         bta_sys_hw_event_stack_enabled
 **
-** Description     we receive this event from once the SW side is ready ( stack, FW download,... ),
+** Description     we receive this event once the SW side is ready ( stack, FW download,... ),
 **                       i.e. we can really start using the device. So notify the app.
 **
 ** Returns          success or failure
@@ -464,6 +465,7 @@
 void bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg)
 {
     UINT8 hw_module_index;
+    UNUSED(p_sys_hw_msg);
 
     APPL_TRACE_DEBUG0(" bta_sys_hw_evt_stack_enabled!notify the callers");
 
diff --git a/btif/co/bta_ag_co.c b/btif/co/bta_ag_co.c
index cd969f8..9c6de7d 100644
--- a/btif/co/bta_ag_co.c
+++ b/btif/co/bta_ag_co.c
@@ -21,6 +21,7 @@
 #include "bta_ag_api.h"
 #include "bta_ag_co.h"
 #include "bte_appl.h"
+#include "bt_utils.h"
 
 #define LOG_TAG "BTA_AG_CO: "
 
@@ -74,6 +75,7 @@
 *******************************************************************************/
 void bta_ag_co_audio_state(UINT16 handle, UINT8 app_id, UINT8 state)
 {
+    UNUSED(app_id);
     BTIF_TRACE_DEBUG2("bta_ag_co_audio_state: handle %d, state %d", handle, state);
 }
 
@@ -127,6 +129,7 @@
  *******************************************************************************/
 void bta_ag_co_tx_write(UINT16 handle, UINT8 * p_data, UINT16 len)
 {
-   BTIF_TRACE_DEBUG2( "bta_ag_co_tx_write: handle: %d, len: %d", handle, len );
+    UNUSED(p_data);
+    BTIF_TRACE_DEBUG2( "bta_ag_co_tx_write: handle: %d, len: %d", handle, len );
 }
 
diff --git a/btif/co/bta_av_co.c b/btif/co/bta_av_co.c
index 6089532..fecf621 100644
--- a/btif/co/bta_av_co.c
+++ b/btif/co/bta_av_co.c
@@ -35,6 +35,7 @@
 #include "btif_media.h"
 #include "sbc_encoder.h"
 #include "btif_av_co.h"
+#include "btif_util.h"
 
 
 /*****************************************************************************
@@ -516,6 +517,8 @@
     UINT8 status = A2D_SUCCESS;
     UINT8 category = A2D_SUCCESS;
     BOOLEAN recfg_needed = FALSE;
+    UNUSED(seid);
+    UNUSED(addr);
 
     FUNC_TRACE();
 
@@ -645,6 +648,7 @@
         UINT16 mtu)
 {
     tBTA_AV_CO_PEER *p_peer;
+    UNUSED(p_codec_info);
 
     FUNC_TRACE();
 
@@ -678,6 +682,8 @@
 
 {
     tBTA_AV_CO_PEER *p_peer;
+    UNUSED(codec_type);
+    UNUSED(mtu);
 
     FUNC_TRACE();
 
@@ -713,6 +719,11 @@
 BTA_API void bta_av_co_audio_start(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
         UINT8 *p_codec_info, BOOLEAN *p_no_rtp_hdr)
 {
+    UNUSED(hndl);
+    UNUSED(codec_type);
+    UNUSED(p_codec_info);
+    UNUSED(p_no_rtp_hdr);
+
     FUNC_TRACE();
 
     APPL_TRACE_DEBUG0("bta_av_co_audio_start");
@@ -732,6 +743,9 @@
  *******************************************************************************/
 BTA_API extern void bta_av_co_audio_stop(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type)
 {
+    UNUSED(hndl);
+    UNUSED(codec_type);
+
     FUNC_TRACE();
 
     APPL_TRACE_DEBUG0("bta_av_co_audio_stop");
@@ -751,6 +765,8 @@
         UINT32 *p_timestamp)
 {
     BT_HDR *p_buf;
+    UNUSED(p_len);
+
     FUNC_TRACE();
 
     p_buf = btif_media_aa_readbuf();
diff --git a/btif/co/bta_dm_co.c b/btif/co/bta_dm_co.c
index fd91817..13a5c8f 100644
--- a/btif/co/bta_dm_co.c
+++ b/btif/co/bta_dm_co.c
@@ -22,6 +22,7 @@
 #include "bta_sys.h"
 #include "bta_dm_co.h"
 #include "bta_dm_ci.h"
+#include "bt_utils.h"
 #if (BTM_OOB_INCLUDED == TRUE)
 #include "btif_dm.h"
 #endif
@@ -46,6 +47,9 @@
 *******************************************************************************/
 BOOLEAN bta_dm_co_get_compress_memory(tBTA_SYS_ID id, UINT8 **memory_p, UINT32 *memory_size)
 {
+    UNUSED(id);
+    UNUSED(memory_p);
+    UNUSED(memory_size);
     return TRUE;
 }
 
@@ -67,6 +71,7 @@
 void bta_dm_co_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap, tBTA_OOB_DATA *p_oob_data,
                       tBTA_AUTH_REQ *p_auth_req, BOOLEAN is_orig)
 {
+    UNUSED(bd_addr);
 #if (BTM_OOB_INCLUDED == TRUE)
     btif_dm_set_oob_for_io_req(p_oob_data);
 #endif
@@ -94,6 +99,10 @@
 void bta_dm_co_io_rsp(BD_ADDR bd_addr, tBTA_IO_CAP io_cap,
                       tBTA_OOB_DATA oob_data, tBTA_AUTH_REQ auth_req)
 {
+    UNUSED(bd_addr);
+    UNUSED(io_cap);
+    UNUSED(oob_data);
+    UNUSED(auth_req);
 }
 
 /*******************************************************************************
@@ -111,6 +120,8 @@
 *******************************************************************************/
 void  bta_dm_co_lk_upgrade(BD_ADDR bd_addr, BOOLEAN *p_upgrade )
 {
+    UNUSED(bd_addr);
+    UNUSED(p_upgrade);
 }
 
 #if (BTM_OOB_INCLUDED == TRUE)
@@ -334,6 +345,7 @@
                              tBTA_LE_KEY_TYPE *p_init_key,
                              tBTA_LE_KEY_TYPE  *p_resp_key )
 {
+    UNUSED(bd_addr);
     BTIF_TRACE_ERROR0("##################################");
     BTIF_TRACE_ERROR0("bta_dm_co_le_io_key_req: only setting max size to 16");
     BTIF_TRACE_ERROR0("##################################");
@@ -389,6 +401,7 @@
                           tBTA_LE_KEY_TYPE *p_init_key,
                           tBTA_LE_KEY_TYPE  *p_resp_key )
 {
+    UNUSED(bd_addr);
     /* if OOB is not supported, this call-out function does not need to do anything
      * otherwise, look for the OOB data associated with the address and set *p_oob_data accordingly
      * If the answer can not be obtained right away,
diff --git a/btif/co/bta_fs_co.c b/btif/co/bta_fs_co.c
index ffc146b..958fef5 100644
--- a/btif/co/bta_fs_co.c
+++ b/btif/co/bta_fs_co.c
@@ -30,6 +30,7 @@
 #include "bta_fs_co.h"
 #include "bta_fs_ci.h"
 #include <inttypes.h>
+#include "bt_utils.h"
 
 #ifndef AID_SYSTEM
 #define AID_SYSTEM        1000
@@ -248,12 +249,12 @@
  *******************************************************************************/
 static int btapp_fs_check_space( const char *p_path, const UINT32 size, const UINT8 app_id )
 {
-
     unsigned long long max_space;
     struct statfs fs_buffer;
     int err = 0;
     char *p_dir;
     char *p_end;
+    UNUSED(app_id);
 
     if(size==BTA_FS_LEN_UNKNOWN)
         return 0;
@@ -455,6 +456,7 @@
     tBTA_FS_CO_STATUS  status = BTA_FS_CO_OK;
     INT32   num_read;
     int     err;
+    UNUSED(ssn);
 
     if ((num_read = read (fd, p_buf, nbytes)) < 0)
     {
@@ -500,6 +502,8 @@
     tBTA_FS_CO_STATUS  status = BTA_FS_CO_OK;
     INT32   num_written;
     int     err=0;
+    UNUSED(ssn);
+    UNUSED(app_id);
 
     if ((num_written = write (fd, p_buf, nbytes)) < 0)
     {
@@ -528,6 +532,7 @@
 *******************************************************************************/
 void bta_fs_co_seek (int fd, INT32 offset, INT16 origin, UINT8 app_id)
 {
+    UNUSED(app_id);
     lseek(fd, offset, origin);
 }
 
@@ -559,6 +564,7 @@
     int os_mode = 0;
     tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
     struct stat buffer;
+    UNUSED(app_id);
 
     #if (TRUE==BTA_FS_DEBUG)
     LOGI("***********CHECKING ACCESS TO = %s", p_path);
@@ -776,6 +782,7 @@
     tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
     char *dirName, *tmp=NULL;
     struct stat buffer;
+    UNUSED(app_id);
 
     if(! p_path)
         return BTA_FS_CO_FAIL;
@@ -856,6 +863,7 @@
     struct dirent *dirent;
     struct stat buf;
     char fullname[500];
+    UNUSED(app_id);
 
     BTIF_TRACE_DEBUG0("Entered bta_fs_co_getdirentry");
 
@@ -978,6 +986,9 @@
 *******************************************************************************/
 void bta_fs_co_setdir(const char *p_path, UINT8 app_id)
 {
+    UNUSED(p_path);
+    UNUSED(app_id);
+
     BTIF_TRACE_DEBUG2("Entered %s. New path: %s", __FUNCTION__, p_path);
 }
 
@@ -1006,6 +1017,9 @@
 *******************************************************************************/
 void bta_fs_co_resume(UINT16 evt, UINT8 app_id)
 {
+    UNUSED(evt);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_resume - NOT implemented");
 }
 
@@ -1031,6 +1045,11 @@
 *******************************************************************************/
 void bta_fs_co_set_perms(const char *p_src_path,  UINT8 *p_perms, UINT16 evt, UINT8 app_id)
 {
+    UNUSED(p_src_path);
+    UNUSED(p_perms);
+    UNUSED(evt);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_set_perms - NOT implemented");
 }
 
@@ -1057,6 +1076,12 @@
 *******************************************************************************/
 void bta_fs_co_rename(const char *p_src_path, const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id)
 {
+    UNUSED(p_src_path);
+    UNUSED(p_dest_path);
+    UNUSED(p_perms);
+    UNUSED(evt);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_rename - NOT implemented");
 }
 
@@ -1085,6 +1110,12 @@
 *******************************************************************************/
 void bta_fs_co_copy(const char *p_src_path, const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id)
 {
+    UNUSED(p_src_path);
+    UNUSED(p_dest_path);
+    UNUSED(p_perms);
+    UNUSED(evt);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_copy - NOT implemented");
 }
 
@@ -1106,6 +1137,10 @@
 *******************************************************************************/
 void bta_fs_co_resume_op(UINT32 offset, UINT16 evt, UINT8 app_id)
 {
+    UNUSED(offset);
+    UNUSED(evt);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_resume_op - NOT implemented");
 }
 
@@ -1129,6 +1164,14 @@
 void bta_fs_co_session_info(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
                                            tBTA_FS_CO_SESS_ST new_st, char *p_path, UINT8 *p_info, UINT8 app_id)
 {
+    UNUSED(bd_addr);
+    UNUSED(p_sess_info);
+    UNUSED(ssn);
+    UNUSED(new_st);
+    UNUSED(p_path);
+    UNUSED(p_info);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_session_info - NOT implemented");
 }
 
@@ -1154,6 +1197,14 @@
 void bta_fs_co_suspend(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
                                       UINT32 *p_timeout, UINT32 *p_offset, UINT8 info, UINT8 app_id)
 {
+    UNUSED(bd_addr);
+    UNUSED(p_sess_info);
+    UNUSED(ssn);
+    UNUSED(p_timeout);
+    UNUSED(p_offset);
+    UNUSED(info);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_suspend - NOT implemented");
 }
 
@@ -1176,6 +1227,10 @@
 *******************************************************************************/
 void bta_fs_co_sess_ssn(int fd, UINT8 ssn, UINT8 app_id)
 {
+    UNUSED(fd);
+    UNUSED(ssn);
+    UNUSED(app_id);
+
     BTIF_TRACE_WARNING0("[CO] bta_fs_co_suspend - NOT implemented");
 }
 
diff --git a/btif/co/bta_gattc_co.c b/btif/co/bta_gattc_co.c
index 1a71d69..29fbb09 100644
--- a/btif/co/bta_gattc_co.c
+++ b/btif/co/bta_gattc_co.c
@@ -20,6 +20,7 @@
 #include "gki.h"
 #include "bta_gattc_co.h"
 #include "bta_gattc_ci.h"
+#include "btif_util.h"
 
 #if( defined BLE_INCLUDED ) && (BLE_INCLUDED == TRUE)
 #if( defined BTA_GATT_INCLUDED ) && (BTA_GATT_INCLUDED == TRUE)
@@ -47,6 +48,7 @@
 void bta_gattc_co_cache_open(BD_ADDR server_bda, UINT16 evt, UINT16 conn_id, BOOLEAN to_save)
 {
     tBTA_GATT_STATUS    status = BTA_GATT_OK;
+    UNUSED(to_save);
 
     /* open NV cache and send call in */
     bta_gattc_ci_cache_open(server_bda, evt, status, conn_id);
@@ -72,6 +74,7 @@
     UINT16              num_attr = 0;
     tBTA_GATTC_NV_ATTR  attr[BTA_GATTC_NV_LOAD_MAX];
     tBTA_GATT_STATUS    status = BTA_GATT_MORE;
+    UNUSED(start_index);
 
     bta_gattc_ci_cache_load(server_bda, evt, num_attr, attr, status, conn_id);
 }
@@ -95,6 +98,9 @@
                               tBTA_GATTC_NV_ATTR *p_attr_list, UINT16 attr_index, UINT16 conn_id)
 {
     tBTA_GATT_STATUS    status = BTA_GATT_OK;
+    UNUSED(num_attr);
+    UNUSED(p_attr_list);
+    UNUSED(attr_index);
 
     bta_gattc_ci_cache_save(server_bda, evt, status, conn_id);
 }
@@ -114,6 +120,8 @@
 *******************************************************************************/
 void bta_gattc_co_cache_close(BD_ADDR server_bda, UINT16 conn_id)
 {
+    UNUSED(server_bda);
+    UNUSED(conn_id);
     /* close NV when server cache is done saving or loading,
        does not need to do anything for now on Insight */
 }
@@ -132,6 +140,7 @@
 *******************************************************************************/
 void bta_gattc_co_cache_reset(BD_ADDR server_bda)
 {
+    UNUSED(server_bda);
 }
 
 #endif
diff --git a/btif/co/bta_gatts_co.c b/btif/co/bta_gatts_co.c
index 16b0450..d030075 100644
--- a/btif/co/bta_gatts_co.c
+++ b/btif/co/bta_gatts_co.c
@@ -25,6 +25,7 @@
 #include "gki.h"
 #include "bd.h"
 #include "bta_gatts_co.h"
+#include "btif_util.h"
 
 /*****************************************************************************
 **  Local type definitions
@@ -202,6 +203,8 @@
 *******************************************************************************/
 void bta_gatts_co_update_handle_range(BOOLEAN is_add, tBTA_GATTS_HNDL_RANGE *p_hndl_range)
 {
+    UNUSED(is_add);
+    UNUSED(p_hndl_range);
 }
 
 /*******************************************************************************
@@ -225,6 +228,10 @@
                              tBTA_GATTS_SRV_CHG_REQ *p_req,
                              tBTA_GATTS_SRV_CHG_RSP *p_rsp)
 {
+    UNUSED(cmd);
+    UNUSED(p_req);
+    UNUSED(p_rsp);
+
     return FALSE;
 }
 
@@ -243,7 +250,10 @@
 BOOLEAN bta_gatts_co_load_handle_range(UINT8 index,
                                        tBTA_GATTS_HNDL_RANGE *p_handle_range)
 {
-   return FALSE;
+    UNUSED(index);
+    UNUSED(p_handle_range);
+
+    return FALSE;
 }
 #endif
 #endif
diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c
index 9db3370..b393099 100644
--- a/btif/co/bta_hh_co.c
+++ b/btif/co/bta_hh_co.c
@@ -30,7 +30,7 @@
 #include "btif_hh.h"
 #include "bta_api.h"
 #include "bta_hh_api.h"
-
+#include "btif_util.h"
 
 
 const char *dev_path = "/dev/uhid";
@@ -365,6 +365,7 @@
                     UINT8 sub_class, UINT8 ctry_code, BD_ADDR peer_addr, UINT8 app_id)
 {
     btif_hh_device_t *p_dev;
+    UNUSED(peer_addr);
 
     APPL_TRACE_DEBUG6("%s: dev_handle = %d, subclass = 0x%02X, mode = %d, "
          "ctry_code = %d, app_id = %d",
diff --git a/btif/co/bta_hl_co.c b/btif/co/bta_hl_co.c
index 2713da1..1432974 100644
--- a/btif/co/bta_hl_co.c
+++ b/btif/co/bta_hl_co.c
@@ -42,7 +42,7 @@
 #include "bta_hl_co.h"
 #include "bta_hl_ci.h"
 #include "btif_hl.h"
-
+#include "btif_util.h"
 
 
 /*****************************************************************************
@@ -427,6 +427,9 @@
                               UINT16 buf_size, UINT8 *p_buf,  UINT16 evt)
 {
     tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL;
+    UNUSED(app_id);
+    UNUSED(buf_size);
+    UNUSED(p_buf);
 
     BTIF_TRACE_ERROR1("%s not supported",__FUNCTION__);
     bta_hl_ci_get_echo_data(mcl_handle,  status, evt);
@@ -453,6 +456,9 @@
                               UINT16 data_size, UINT8 *p_data, UINT16 evt)
 {
     tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL;
+    UNUSED(app_id);
+    UNUSED(data_size);
+    UNUSED(p_data);
 
     BTIF_TRACE_ERROR1("%s not supported",__FUNCTION__);
     bta_hl_ci_put_echo_data(mcl_handle,  status, evt);
diff --git a/btif/co/bta_pan_co.c b/btif/co/bta_pan_co.c
index c6310d4..1dcce8e 100644
--- a/btif/co/bta_pan_co.c
+++ b/btif/co/bta_pan_co.c
@@ -35,7 +35,7 @@
 #include "btif_pan_internal.h"
 #include "bd.h"
 #include <string.h>
-
+#include "btif_util.h"
 
 /*******************************************************************************
 **
@@ -218,6 +218,9 @@
 *******************************************************************************/
 void bta_pan_co_rx_path(UINT16 handle, UINT8 app_id)
 {
+    UNUSED(handle);
+    UNUSED(app_id);
+
     BTIF_TRACE_API0("bta_pan_co_rx_path not used");
 }
 
@@ -238,7 +241,17 @@
                                 UINT16 protocol, UINT8 *p_data,
                                 UINT16 len, BOOLEAN ext, BOOLEAN forward)
 {
-     BTIF_TRACE_API0("bta_pan_co_tx_write not used");
+    UNUSED(handle);
+    UNUSED(app_id);
+    UNUSED(src);
+    UNUSED(dst);
+    UNUSED(protocol);
+    UNUSED(p_data);
+    UNUSED(len);
+    UNUSED(ext);
+    UNUSED(forward);
+
+    BTIF_TRACE_API0("bta_pan_co_tx_write not used");
 }
 
 /*******************************************************************************
@@ -258,6 +271,15 @@
                                     BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf,
                                     BOOLEAN ext, BOOLEAN forward)
 {
+    UNUSED(handle);
+    UNUSED(app_id);
+    UNUSED(src);
+    UNUSED(dst);
+    UNUSED(protocol);
+    UNUSED(p_buf);
+    UNUSED(ext);
+    UNUSED(forward);
+
     BTIF_TRACE_API0("bta_pan_co_tx_writebuf not used");
 }
 
@@ -277,6 +299,10 @@
 *******************************************************************************/
 void bta_pan_co_rx_flow(UINT16 handle, UINT8 app_id, BOOLEAN enable)
 {
+    UNUSED(handle);
+    UNUSED(app_id);
+    UNUSED(enable);
+
     BTIF_TRACE_API1("bta_pan_co_rx_flow, enabled:%d, not used", enable);
 }
 
@@ -292,6 +318,12 @@
 void bta_pan_co_pfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
                                     UINT16 len, UINT8 *p_filters)
 {
+    UNUSED(handle);
+    UNUSED(indication);
+    UNUSED(result);
+    UNUSED(len);
+    UNUSED(p_filters);
+
     BTIF_TRACE_API0("bta_pan_co_pfilt_ind");
 }
 
@@ -307,6 +339,12 @@
 void bta_pan_co_mfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
                                     UINT16 len, UINT8 *p_filters)
 {
+    UNUSED(handle);
+    UNUSED(indication);
+    UNUSED(result);
+    UNUSED(len);
+    UNUSED(p_filters);
+
     BTIF_TRACE_API0("bta_pan_co_mfilt_ind");
 }
 
diff --git a/btif/src/bluetooth.c b/btif/src/bluetooth.c
index aa42dbc..9619d8f 100755
--- a/btif/src/bluetooth.c
+++ b/btif/src/bluetooth.c
@@ -423,13 +423,16 @@
 
 static int close_bluetooth_stack(struct hw_device_t* device)
 {
+    UNUSED(device);
     cleanup();
     return 0;
 }
 
 static int open_bluetooth_stack (const struct hw_module_t* module, char const* name,
-struct hw_device_t** abstraction)
+                                 struct hw_device_t** abstraction)
 {
+    UNUSED(name);
+
     bluetooth_device_t *stack = malloc(sizeof(bluetooth_device_t) );
     memset(stack, 0, sizeof(bluetooth_device_t) );
     stack->common.tag = HARDWARE_DEVICE_TAG;
diff --git a/btif/src/btif_av.c b/btif/src/btif_av.c
index f173f6a..3c0c293 100755
--- a/btif/src/btif_av.c
+++ b/btif/src/btif_av.c
@@ -201,6 +201,7 @@
 static void btif_initiate_av_open_tmr_hdlr(TIMER_LIST_ENT *tle)
 {
     BD_ADDR peer_addr;
+    UNUSED(tle);
 
     /* is there at least one RC connection - There should be */
     if (btif_rc_get_connected_peer(peer_addr)) {
diff --git a/btif/src/btif_config.c b/btif/src/btif_config.c
index 8b36a11..e7809a7 100644
--- a/btif/src/btif_config.c
+++ b/btif/src/btif_config.c
@@ -49,6 +49,7 @@
 #include "btif_config_util.h"
 #include "btif_sock_thread.h"
 #include "btif_sock_util.h"
+#include "btif_util.h"
 
 //#define UNIT_TEST
 #define CFG_PATH "/data/misc/bluedroid/"
@@ -781,6 +782,10 @@
 }
 static void cfg_cmd_callback(int cmd_fd, int type, int size, uint32_t user_id)
 {
+    UNUSED(cmd_fd);
+    UNUSED(size);
+    UNUSED(user_id);
+
   //bdld("cmd type:%d, size:%d", type, size);
     switch(type)
     {
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 9504c3c..7d17ebf 100644
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -275,6 +275,7 @@
 {
     UINT16   event;
     BT_HDR   *p_msg;
+    UNUSED(params);
 
     BTIF_TRACE_DEBUG0("btif task starting");
 
@@ -821,6 +822,7 @@
 *******************************************************************************/
 static void btif_dut_mode_cback( tBTM_VSC_CMPL *p )
 {
+    UNUSED(p);
     /* For now nothing to be done. */
 }
 
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 3baee2b..cd75b3e 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -2029,11 +2029,12 @@
 ** Returns          bt_status_t
 **
 *******************************************************************************/
-
 bt_status_t btif_dm_ssp_reply(const bt_bdaddr_t *bd_addr,
                                  bt_ssp_variant_t variant, uint8_t accept,
                                  uint32_t passkey)
 {
+    UNUSED(passkey);
+
     if (variant == BT_SSP_VARIANT_PASSKEY_ENTRY)
     {
         /* This is not implemented in the stack.
diff --git a/btif/src/btif_gatt_test.c b/btif/src/btif_gatt_test.c
index 2a316fe..a2cca6a 100644
--- a/btif/src/btif_gatt_test.c
+++ b/btif/src/btif_gatt_test.c
@@ -103,6 +103,10 @@
 static void btif_test_connect_cback(tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
                                     BOOLEAN connected, tGATT_DISCONN_REASON reason)
 {
+    UNUSED(gatt_if);
+    UNUSED(bda);
+    UNUSED(reason);
+
     ALOGD("%s: conn_id=%d, connected=%d", __FUNCTION__, conn_id, connected);
     test_cb.conn_id = connected ? conn_id : 0;
 }
@@ -137,6 +141,7 @@
                                            tGATT_DISC_RES *p_data)
 {
     char    str_buf[50];
+    UNUSED(conn_id);
 
     ALOGD("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
     ALOGD("      Attribute handle: 0x%04x (%d)", p_data->handle, p_data->handle);
@@ -188,6 +193,8 @@
                                                tGATT_DISC_TYPE disc_type,
                                                tGATT_STATUS status)
 {
+    UNUSED(conn_id);
+    UNUSED(disc_type);
     ALOGD("%s: status=%d", __FUNCTION__, status);
 }
 
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index 7688e68..b4ade0d 100644
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -452,6 +452,8 @@
 *******************************************************************************/
 static void btif_in_hf_generic_evt(UINT16 event, char *p_param)
 {
+    UNUSED(p_param);
+
     BTIF_TRACE_EVENT2("%s: event=%d", __FUNCTION__, event);
     switch (event) {
         case BTIF_HFP_CB_AUDIO_CONNECTING:
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c
index 1aca7df..d41cdb1 100644
--- a/btif/src/btif_hh.c
+++ b/btif/src/btif_hh.c
@@ -1442,6 +1442,8 @@
 *******************************************************************************/
 static bt_status_t set_idle_time (bt_bdaddr_t *bd_addr, uint8_t idle_time)
 {
+    UNUSED(idle_time);
+
     CHECK_BTHH_INIT();
     btif_hh_device_t *p_dev;
     BD_ADDR* bda = (BD_ADDR*) bd_addr;
@@ -1480,6 +1482,7 @@
     CHECK_BTHH_INIT();
     btif_hh_device_t *p_dev;
     BD_ADDR* bda = (BD_ADDR*) bd_addr;
+    UNUSED(protocolMode);
 
     BTIF_TRACE_DEBUG6(" addr = %02X:%02X:%02X:%02X:%02X:%02X",
          (*bda)[0], (*bda)[1], (*bda)[2], (*bda)[3], (*bda)[4], (*bda)[5]);
@@ -1649,7 +1652,6 @@
         //TODO
         hex_bytes_filled = ascii_2_hex(report, len, hexbuf);
         ALOGI("Hex bytes filled, hex value: %d", hex_bytes_filled);
-
         if (hex_bytes_filled) {
             UINT8* pbuf_data;
             pbuf_data = (UINT8*) (p_dev->p_buf + 1) + p_dev->p_buf->offset;
diff --git a/btif/src/btif_hl.c b/btif/src/btif_hl.c
index 28a1461..e80a0b9 100644
--- a/btif/src/btif_hl.c
+++ b/btif/src/btif_hl.c
@@ -1857,21 +1857,22 @@
                                            UINT8 *p_app_idx){
     btif_hl_app_cb_t  *p_acb;
     BOOLEAN         found=FALSE;
-    UINT8 i,j;
+    UINT8 i;
 
     for (i=0; i<BTA_HL_NUM_APPS; i++)
     {
         p_acb =BTIF_HL_GET_APP_CB_PTR(i);
-        if (p_acb->delete_mdl.active)
-                BTIF_TRACE_DEBUG3("btif_hl_find_app_idx_using_deleted_mdl_id: app_idx=%d,"
-                    "mcl_idx =%d mcl_handle=%d",i,j,p_acb->mcb[j].mcl_handle);
-            if (p_acb->delete_mdl.active &&
-                (p_acb->delete_mdl.mdl_id == mdl_id))
-            {
-                found = TRUE;
-                *p_app_idx = i;
-                break;
-            }
+        if (p_acb->delete_mdl.active) {
+            BTIF_TRACE_DEBUG3("btif_hl_find_app_idx_using_deleted_mdl_id: app_idx=%d,"
+                              "mdl_id=%d mcl_handle=%d",i,mdl_id,p_acb->mcb[i].mcl_handle);
+        }
+        if (p_acb->delete_mdl.active &&
+            (p_acb->delete_mdl.mdl_id == mdl_id))
+        {
+            found = TRUE;
+            *p_app_idx = i;
+            break;
+        }
     }
     BTIF_TRACE_DEBUG3("%s found=%d app_idx=%d",__FUNCTION__,
                       found, i);
@@ -2823,7 +2824,7 @@
     btif_hl_app_cb_t         *p_acb;
     btif_hl_mcl_cb_t         *p_mcb;
     btif_hl_mdl_cb_t         *p_dcb;
-    UINT8                    app_idx,orig_app_idx, mcl_idx, mdl_idx, mdep_cfg_idx;
+    UINT8                    orig_app_idx, mcl_idx, mdl_idx, mdep_cfg_idx;
     UINT8                    dc_cfg;
     BOOLEAN close_dch = FALSE;
 
@@ -2856,7 +2857,7 @@
                 if(btif_hl_find_channel_id_using_mdl_id(orig_app_idx,p_dcb->mdl_id , &p_dcb->channel_id))
                 {
                     BTIF_TRACE_DEBUG4(" app_idx=%d mcl_idx=%d mdl_idx=%d channel_id=%d",
-                                        app_idx, mcl_idx, mdl_idx, p_dcb->channel_id  );
+                                        orig_app_idx, mcl_idx, mdl_idx, p_dcb->channel_id  );
                     if (!btif_hl_create_socket(orig_app_idx, mcl_idx, mdl_idx))
                     {
                         BTIF_TRACE_ERROR0("Unable to create socket");
@@ -3262,6 +3263,7 @@
                                        tBTA_HL_STATUS status){
     UINT8                   app_idx,mcl_idx, mdl_idx;
     btif_hl_mdl_cb_t         *p_dcb;
+    UNUSED(status);
 
     BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
     if (btif_hl_find_mdl_idx_using_handle(mdl_handle,
@@ -3301,7 +3303,7 @@
 
 /*******************************************************************************
 **
-** Function         btif_hl_proc_cb_evt
+** Function         btif_hl_proc_reg_request
 **
 ** Description      Process registration request
 **
@@ -3314,6 +3316,8 @@
     bt_status_t status= BT_STATUS_SUCCESS;
     UINT8 i;
     btif_hl_app_data_t *p_data;
+    UNUSED(p_cback);
+
     BTIF_TRACE_DEBUG3("%s app_idx=%d app_id=%d", __FUNCTION__, app_idx, app_id);
 
     if(reg_counter >1)
@@ -4929,6 +4933,7 @@
     btif_hl_soc_cb_t      *p_scb = NULL;
     btif_hl_mdl_cb_t      *p_dcb = NULL;
     int r;
+    UNUSED(p_org_set);
 
     BTIF_TRACE_DEBUG1("entering %s",__FUNCTION__);
 
@@ -5131,6 +5136,7 @@
 static void *btif_hl_select_thread(void *arg){
     fd_set org_set, curr_set;
     int r, max_curr_s, max_org_s;
+    UNUSED(arg);
 
     BTIF_TRACE_DEBUG0("entered btif_hl_select_thread");
     FD_ZERO(&org_set);
diff --git a/btif/src/btif_media_task.c b/btif/src/btif_media_task.c
index d4d85f2..0b9b613 100755
--- a/btif/src/btif_media_task.c
+++ b/btif/src/btif_media_task.c
@@ -66,7 +66,6 @@
 #include "btif_av.h"
 #include "btif_sm.h"
 #include "btif_util.h"
-#include "bt_utils.h"
 
 /*****************************************************************************
  **  Constants
@@ -526,6 +525,8 @@
 
 static void btif_a2dp_ctrl_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event)
 {
+    UNUSED(ch_id);
+
     APPL_TRACE_DEBUG1("A2DP-CTRL-CHANNEL EVENT %s", dump_uipc_event(event));
 
     switch(event)
@@ -553,6 +554,8 @@
 
 static void btif_a2dp_data_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event)
 {
+    UNUSED(ch_id);
+
     APPL_TRACE_DEBUG1("BTIF MEDIA (A2DP-DATA) EVENT %s", dump_uipc_event(event));
 
     switch(event)
@@ -1115,6 +1118,7 @@
 {
     UINT16 event;
     BT_HDR *p_msg;
+    UNUSED(p);
 
     VERBOSE("================ MEDIA TASK STARTING ================");
 
@@ -1438,6 +1442,8 @@
  *******************************************************************************/
 static void btif_media_task_aa_tx_flush(BT_HDR *p_msg)
 {
+    UNUSED(p_msg);
+
     /* Flush all enqueued GKI music buffers (encoded) */
     APPL_TRACE_DEBUG0("btif_media_task_aa_tx_flush");
 
diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c
index 633f6ef..4824627 100644
--- a/btif/src/btif_pan.c
+++ b/btif/src/btif_pan.c
@@ -389,6 +389,8 @@
 int btpan_tap_send(int tap_fd, const BD_ADDR src, const BD_ADDR dst, UINT16 proto, const char* buf,
                     UINT16 len, BOOLEAN ext, BOOLEAN forward)
 {
+    UNUSED(ext);
+    UNUSED(forward);
     if(tap_fd != -1)
     {
         tETH_HDR eth_hdr;
@@ -606,6 +608,9 @@
 {
     char packet[MAX_PACKET_SIZE];
     tETH_HDR eth_hdr;
+    UNUSED(type);
+    UNUSED(user_id);
+
     if(flags & SOCK_THREAD_FD_EXCEPTION)
     {
         BTIF_TRACE_ERROR1("pan tap fd:%d exception", fd);
diff --git a/btif/src/btif_rc.c b/btif/src/btif_rc.c
index d4ac0f1..b2cd335 100755
--- a/btif/src/btif_rc.c
+++ b/btif/src/btif_rc.c
@@ -764,6 +764,8 @@
 /* clear the queued PLAY command. if bSend is TRUE, forward to app */
 void btif_rc_check_handle_pending_play (BD_ADDR peer_addr, BOOLEAN bSendToApp)
 {
+    UNUSED(peer_addr);
+
     BTIF_TRACE_DEBUG2("%s: bSendToApp=%d", __FUNCTION__, bSendToApp);
     if (btif_rc_cb.rc_pending_play)
     {
diff --git a/btif/src/btif_sock_rfc.c b/btif/src/btif_sock_rfc.c
index cdc51a9..d70e499 100644
--- a/btif/src/btif_sock_rfc.c
+++ b/btif/src/btif_sock_rfc.c
@@ -638,6 +638,7 @@
 }
 static void on_rfc_close(tBTA_JV_RFCOMM_CLOSE * p_close, uint32_t id)
 {
+    UNUSED(p_close);
     lock_slot(&slot_lock);
     rfc_slot_t* rs = find_rfc_slot_by_id(id);
     if(rs)
@@ -653,6 +654,8 @@
 }
 static void on_rfc_write_done(tBTA_JV_RFCOMM_WRITE *p, uint32_t id)
 {
+    UNUSED(p);
+
     lock_slot(&slot_lock);
     rfc_slot_t* rs = find_rfc_slot_by_id(id);
     if(rs && !rs->f.outgoing_congest)
diff --git a/gki/ulinux/gki_ulinux.c b/gki/ulinux/gki_ulinux.c
index e414864..d03eb05 100755
--- a/gki/ulinux/gki_ulinux.c
+++ b/gki/ulinux/gki_ulinux.c
@@ -247,6 +247,8 @@
     struct sched_param param;
     int policy, ret = 0;
     pthread_attr_t attr1;
+    UNUSED(stack);
+    UNUSED(stacksize);
 
     GKI_TRACE( "GKI_create_task %x %d %s %x %d", (int)task_entry, (int)task_id,
             (char*) taskname, (int) stack, (int)stacksize);
@@ -617,6 +619,7 @@
     int restart;
     tGKI_OS         *p_os = &gki_cb.os;
     int  *p_run_cond = &p_os->no_timer_suspend;
+    (void)arg;
 
     /* Indicate that tick is just starting */
     restart = 1;
@@ -783,11 +786,12 @@
 **
 *******************************************************************************/
 
-void GKI_run (void *p_task_id)
+void GKI_run (void * p_task_id)
 {
     struct timespec delay;
     int err;
     volatile int * p_run_cond = &gki_cb.os.no_timer_suspend;
+    UNUSED(p_task_id);
 
 #ifndef GKI_NO_TICK_STOP
     /* adjust btld scheduling scheme now */
@@ -1404,9 +1408,9 @@
 *******************************************************************************/
 UINT8 GKI_suspend_task (UINT8 task_id)
 {
+    UNUSED(task_id);
     GKI_TRACE("GKI_suspend_task %d - NOT implemented", task_id);
 
-
     GKI_TRACE("GKI_suspend_task %d done", task_id);
 
     return (GKI_SUCCESS);
@@ -1430,9 +1434,9 @@
 *******************************************************************************/
 UINT8 GKI_resume_task (UINT8 task_id)
 {
+    UNUSED(task_id);
     GKI_TRACE("GKI_resume_task %d - NOT implemented", task_id);
 
-
     GKI_TRACE("GKI_resume_task %d done", task_id);
 
     return (GKI_SUCCESS);
diff --git a/hci/src/bt_hci_bdroid.c b/hci/src/bt_hci_bdroid.c
index 25ad194..ed98b37 100644
--- a/hci/src/bt_hci_bdroid.c
+++ b/hci/src/bt_hci_bdroid.c
@@ -125,6 +125,7 @@
 *******************************************************************************/
 static void epilog_wait_timeout(union sigval arg)
 {
+    UNUSED(arg);
     ALOGI("...epilog_wait_timeout...");
     bthc_signal_event(HC_EVENT_EXIT);
 }
@@ -299,9 +300,10 @@
 }
 
 
-/** Called prio to stack initialization */
+/** Called prior to stack initialization */
 static void preload(TRANSAC transac)
 {
+    UNUSED(transac);
     BTHCDBG("preload");
     bthc_signal_event(HC_EVENT_PRELOAD);
 }
@@ -310,14 +312,17 @@
 /** Called post stack initialization */
 static void postload(TRANSAC transac)
 {
+    UNUSED(transac);
     BTHCDBG("postload");
     bthc_signal_event(HC_EVENT_POSTLOAD);
 }
 
 
 /** Transmit frame */
-static int transmit_buf(TRANSAC transac, char *p_buf, int len)
+static int transmit_buf(TRANSAC transac, char * p_buf, int len)
 {
+    UNUSED(p_buf);
+    UNUSED(len);
     utils_enqueue(&tx_q, (void *) transac);
 
     bthc_signal_event(HC_EVENT_TX);
@@ -427,6 +432,7 @@
 {
     uint16_t events;
     HC_BT_HDR *p_msg, *p_next_msg;
+    UNUSED(arg);
 
     ALOGI("bt_hc_worker_thread started");
     prctl(PR_SET_NAME, (unsigned long)"bt_hc_worker", 0, 0, 0);
@@ -506,7 +512,7 @@
             utils_lock();
             p_next_msg = tx_q.p_first;
             while (p_next_msg && sending_msg_count <
-                            (int)sizeof(sending_msg_que)/sizeof(sending_msg_que[0]))
+		   (int)(sizeof(sending_msg_que)/sizeof(sending_msg_que[0])))
             {
                 if ((p_next_msg->event & MSG_EVT_MASK)==MSG_STACK_TO_HC_HCI_CMD)
                 {
diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c
index 5265dce..898a6ed 100644
--- a/hci/src/bt_hw.c
+++ b/hci/src/bt_hw.c
@@ -33,6 +33,7 @@
 #include "bt_hci_bdroid.h"
 #include "hci.h"
 #include "userial.h"
+#include "bt_utils.h"
 
 /******************************************************************************
 **  Externs
@@ -87,6 +88,7 @@
 ******************************************************************************/
 static void scocfg_cb(bt_vendor_op_result_t result)
 {
+    UNUSED(result);
     /* Continue rest of postload process*/
     p_hci_if->get_acl_max_len();
 }
@@ -178,6 +180,7 @@
 ******************************************************************************/
 static void epilog_cb(bt_vendor_op_result_t result)
 {
+    UNUSED(result);
     bthc_signal_event(HC_EVENT_EXIT);
 }
 
diff --git a/hci/src/btsnoop.c b/hci/src/btsnoop.c
index 5b0f26d..c6556d6 100755
--- a/hci/src/btsnoop.c
+++ b/hci/src/btsnoop.c
@@ -55,6 +55,7 @@
 
 #include "bt_hci_bdroid.h"
 #include "utils.h"
+#include "bt_utils.h"
 
 #ifndef BTSNOOP_DBG
 #define BTSNOOP_DBG FALSE
@@ -478,6 +479,7 @@
 
 static void interruptFn (int sig)
 {
+    UNUSED(sig);
     ALOGD("interruptFn");
     pthread_exit(0);
 }
@@ -489,6 +491,7 @@
     sigset_t sigSet;
     sigemptyset (&sigSet);
     sigaddset (&sigSet, sig);
+    UNUSED(param);
 
     ALOGD("ext_parser_thread");
 
diff --git a/hci/src/lpm.c b/hci/src/lpm.c
index fb6f837..b8cfdce 100644
--- a/hci/src/lpm.c
+++ b/hci/src/lpm.c
@@ -31,6 +31,7 @@
 #include <time.h>
 #include "bt_hci_bdroid.h"
 #include "bt_vendor_lib.h"
+#include "bt_utils.h"
 
 /******************************************************************************
 **  Constants & Macros
@@ -109,6 +110,7 @@
 *******************************************************************************/
 static void lpm_idle_timeout(union sigval arg)
 {
+    UNUSED(arg);
     BTLPMDBG("..lpm_idle_timeout..");
 
     if ((bt_lpm_cb.state == LPM_ENABLED) && \
diff --git a/hci/src/userial.c b/hci/src/userial.c
index 426810f..5dc4f84 100644
--- a/hci/src/userial.c
+++ b/hci/src/userial.c
@@ -241,6 +241,7 @@
     int rx_length = 0;
     HC_BT_HDR *p_buf = NULL;
     uint8_t *p;
+    UNUSED(arg);
 
     USERIALDBG("Entering userial_read_thread()");
     prctl(PR_SET_NAME, (unsigned long)"userial_read", 0, 0, 0);
@@ -432,6 +433,7 @@
     uint16_t total_len = 0;
     uint16_t copy_len = 0;
     uint8_t *p_data = NULL;
+    UNUSED(msg_id);
 
     do
     {
@@ -484,6 +486,7 @@
 uint16_t userial_write(uint16_t msg_id, uint8_t *p_data, uint16_t len)
 {
     int ret, total = 0;
+    UNUSED(msg_id);
 
     while(len != 0)
     {
@@ -546,6 +549,8 @@
 *******************************************************************************/
 void userial_ioctl(userial_ioctl_op_t op, void *p_data)
 {
+    UNUSED(p_data);
+
     switch(op)
     {
         case USERIAL_OP_RXFLOW_ON:
diff --git a/main/bte_conf.c b/main/bte_conf.c
index e001d59..ddad0c7 100644
--- a/main/bte_conf.c
+++ b/main/bte_conf.c
@@ -35,6 +35,7 @@
 
 #include "bt_target.h"
 #include "bta_api.h"
+#include "bt_utils.h"
 
 /******************************************************************************
 **  Externs
@@ -130,6 +131,7 @@
 
 int device_name_cfg(char *p_conf_name, char *p_conf_value)
 {
+    UNUSED(p_conf_name);
     strcpy((char *)local_device_default_name, p_conf_value);
     return 0;
 }
@@ -138,6 +140,7 @@
 {
     char *p_token;
     unsigned int x;
+    UNUSED(p_conf_name);
 
     p_token = strtok(p_conf_value, CONF_COD_DELIMITERS);
     sscanf(p_token, "%x", &x);
@@ -154,6 +157,7 @@
 
 int logging_cfg_onoff(char *p_conf_name, char *p_conf_value)
 {
+    UNUSED(p_conf_name);
     if (strcmp(p_conf_value, "true") == 0)
         hci_logging_enabled = TRUE;
     else
@@ -163,12 +167,14 @@
 
 int logging_set_filepath(char *p_conf_name, char *p_conf_value)
 {
+    UNUSED(p_conf_name);
     strcpy(hci_logfile, p_conf_value);
     return 0;
 }
 
 int trace_cfg_onoff(char *p_conf_name, char *p_conf_value)
 {
+    UNUSED(p_conf_name);
     trace_conf_enabled = (strcmp(p_conf_value, "true") == 0) ? TRUE : FALSE;
     return 0;
 }
diff --git a/main/bte_main.c b/main/bte_main.c
index 62c6b6b..cf21456 100644
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -36,6 +36,7 @@
 #include "bte.h"
 #include "bta_api.h"
 #include "bt_hci_lib.h"
+#include "bt_utils.h"
 
 /*******************************************************************************
 **  Constants & Macros
@@ -337,6 +338,8 @@
 *******************************************************************************/
 static void preload_wait_timeout(union sigval arg)
 {
+    UNUSED(arg);
+
     APPL_TRACE_ERROR2("...preload_wait_timeout (retried:%d/max-retry:%d)...",
                         preload_retry_cb.retry_counts,
                         PRELOAD_MAX_RETRY_ATTEMPTS);
@@ -559,8 +562,9 @@
 ******************************************************************************/
 static void preload_cb(TRANSAC transac, bt_hc_preload_result_t result)
 {
-    APPL_TRACE_EVENT1("HC preload_cb %d [0:SUCCESS 1:FAIL]", result);
+    UNUSED(transac);
 
+    APPL_TRACE_EVENT1("HC preload_cb %d [0:SUCCESS 1:FAIL]", result);
 
     if (result == BT_HC_PRELOAD_SUCCESS)
     {
@@ -583,6 +587,8 @@
 ******************************************************************************/
 static void postload_cb(TRANSAC transac, bt_hc_postload_result_t result)
 {
+    UNUSED(transac);
+
     APPL_TRACE_EVENT1("HC postload_cb %d", result);
 }
 
@@ -663,6 +669,8 @@
 ******************************************************************************/
 static int dealloc(TRANSAC transac, char *p_buf)
 {
+    UNUSED(p_buf);
+
     GKI_freebuf(transac);
     return BT_HC_STATUS_SUCCESS;
 }
@@ -690,6 +698,8 @@
 static int data_ind(TRANSAC transac, char *p_buf, int len)
 {
     BT_HDR *p_msg = (BT_HDR *) transac;
+    UNUSED(p_buf);
+    UNUSED(len);
 
     /*
     APPL_TRACE_DEBUG2("HC data_ind event=0x%04X (len=%d)", p_msg->event, len);
@@ -719,9 +729,9 @@
 ** Returns          bt_hc_status_t
 **
 ******************************************************************************/
-static int tx_result(TRANSAC transac, char *p_buf, \
-                      bt_hc_transmit_result_t result)
+static int tx_result(TRANSAC transac, char *p_buf, bt_hc_transmit_result_t result)
 {
+    UNUSED(p_buf);
     /*
     APPL_TRACE_DEBUG2("HC tx_result %d (event=%04X)", result, \
                       ((BT_HDR *)transac)->event);
diff --git a/stack/avct/avct_api.c b/stack/avct/avct_api.c
index 7e37a90..d590cb5 100644
--- a/stack/avct/avct_api.c
+++ b/stack/avct/avct_api.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gki.h"
 #include "l2c_api.h"
 #include "l2cdefs.h"
@@ -53,6 +54,8 @@
 *******************************************************************************/
 void AVCT_Register(UINT16 mtu, UINT16 mtu_br, UINT8 sec_mask)
 {
+    UNUSED(mtu_br);
+
     AVCT_TRACE_API0("AVCT_Register");
 
     /* register PSM with L2CAP */
@@ -289,6 +292,8 @@
 
     return result;
 #else
+    UNUSED(handle);
+    UNUSED(role);
     return AVCT_NO_RESOURCES;
 #endif
 }
@@ -326,6 +331,7 @@
     }
     return result;
 #else
+    UNUSED(handle);
     return AVCT_NO_RESOURCES;
 #endif
 }
@@ -350,6 +356,8 @@
     {
         peer_mtu = p_ccb->p_bcb->peer_mtu;
     }
+#else
+    UNUSED(handle);
 #endif
     return peer_mtu;
 }
diff --git a/stack/avct/avct_l2c.c b/stack/avct/avct_l2c.c
index ef0f5fc..aabcd0e 100644
--- a/stack/avct/avct_l2c.c
+++ b/stack/avct/avct_l2c.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avct_api.h"
 #include "avct_int.h"
 #include "l2c_api.h"
@@ -105,6 +106,7 @@
     tAVCT_LCB       *p_lcb;
     UINT16          result = L2CAP_CONN_OK;
     tL2CAP_CFG_INFO cfg;
+    UNUSED(psm);
 
     /* do we already have a channel for this peer? */
     if ((p_lcb = avct_lcb_by_bd(bd_addr)) == NULL)
diff --git a/stack/avct/avct_lcb.c b/stack/avct/avct_lcb.c
index bb3f447..6bc7e51 100644
--- a/stack/avct/avct_lcb.c
+++ b/stack/avct/avct_lcb.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avct_api.h"
 #include "avct_int.h"
 #include "gki.h"
@@ -351,6 +352,7 @@
     tAVCT_CCB   *p_ccb = &avct_cb.ccb[0];
     BOOLEAN     found = FALSE;
     int         i;
+    UNUSED(p_data);
 
     AVCT_TRACE_DEBUG1("avct_lcb_dealloc %d", p_lcb->allocated);
 
diff --git a/stack/avct/avct_lcb_act.c b/stack/avct/avct_lcb_act.c
index b883517..2fc9217 100644
--- a/stack/avct/avct_lcb_act.c
+++ b/stack/avct/avct_lcb_act.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avct_api.h"
 #include "avct_int.h"
 #include "gki.h"
@@ -170,6 +171,7 @@
 void avct_lcb_chnl_open(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
     UINT16 result = AVCT_RESULT_FAIL;
+    UNUSED(p_data);
 
     BTM_SetOutService(p_lcb->peer_addr, BTM_SEC_SERVICE_AVCTP, 0);
     /* call l2cap connect req */
@@ -193,6 +195,8 @@
 *******************************************************************************/
 void avct_lcb_unbind_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
+    UNUSED(p_lcb);
+
     avct_ccb_dealloc(p_data->p_ccb, AVCT_DISCONNECT_CFM_EVT, 0, NULL);
 }
 
@@ -290,6 +294,7 @@
 {
     tAVCT_CCB           *p_ccb = &avct_cb.ccb[0];
     int                 i;
+    UNUSED(p_data);
 
     for (i = 0; i < AVCT_NUM_CONN; i++, p_ccb++)
     {
@@ -416,6 +421,8 @@
 *******************************************************************************/
 void avct_lcb_chnl_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     L2CA_DisconnectReq(p_lcb->ch_lcid);
 }
 
@@ -432,6 +439,8 @@
 *******************************************************************************/
 void avct_lcb_bind_fail(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
+    UNUSED(p_lcb);
+
     avct_ccb_dealloc(p_data->p_ccb, AVCT_CONNECT_CFM_EVT, AVCT_RESULT_FAIL, NULL);
 }
 
@@ -488,6 +497,8 @@
 *******************************************************************************/
 void avct_lcb_discard_msg(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
+    UNUSED(p_lcb);
+
     AVCT_TRACE_WARNING0("Dropping msg");
 
     GKI_freebuf(p_data->ul_msg.p_buf);
@@ -623,6 +634,8 @@
 *******************************************************************************/
 void avct_lcb_free_msg_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
 {
+    UNUSED(p_lcb);
+
     if (p_data)
         GKI_freebuf(p_data->p_buf);
     return;
diff --git a/stack/avdt/avdt_ad.c b/stack/avdt/avdt_ad.c
index 92f429a..7fe665c 100644
--- a/stack/avdt/avdt_ad.c
+++ b/stack/avdt/avdt_ad.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -322,6 +323,7 @@
     tAVDT_CCB   *p_ccb;
     tAVDT_SCB   *p_scb;
     tAVDT_SCB_TC_CLOSE  close;
+    UNUSED(reason);
 
     close.old_tc_state = p_tbl->state;
     /* clear avdt_ad_tc_tbl entry */
diff --git a/stack/avdt/avdt_ccb.c b/stack/avdt/avdt_ccb.c
index f238c69..c2ef2f4 100644
--- a/stack/avdt/avdt_ccb.c
+++ b/stack/avdt/avdt_ccb.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -415,6 +416,8 @@
 *******************************************************************************/
 void avdt_ccb_dealloc(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     AVDT_TRACE_DEBUG1("avdt_ccb_dealloc %d", avdt_ccb_to_idx(p_ccb));
     btu_stop_timer(&p_ccb->timer_entry);
     memset(p_ccb, 0, sizeof(tAVDT_CCB));
diff --git a/stack/avdt/avdt_ccb_act.c b/stack/avdt/avdt_ccb_act.c
index 12c11b4..1249c63 100644
--- a/stack/avdt/avdt_ccb_act.c
+++ b/stack/avdt/avdt_ccb_act.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -86,6 +87,8 @@
 *******************************************************************************/
 void avdt_ccb_chan_open(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     BTM_SetOutService(p_ccb->peer_addr, BTM_SEC_SERVICE_AVDTP, AVDT_CHAN_SIG);
     avdt_ad_open_req(AVDT_CHAN_SIG, p_ccb, NULL, AVDT_INT);
 }
@@ -103,6 +106,8 @@
 *******************************************************************************/
 void avdt_ccb_chan_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     /* close the transport channel used by this CCB */
     avdt_ad_close_req(AVDT_CHAN_SIG, p_ccb, NULL);
 }
@@ -122,6 +127,7 @@
 {
     int         i;
     tAVDT_SCB   *p_scb = &avdt_cb.scb[0];
+    UNUSED(p_data);
 
     /* see if there are any active scbs associated with this ccb */
     for (i = 0; i < AVDT_NUM_SEPS; i++, p_scb++)
@@ -666,6 +672,7 @@
     int             i;
     tAVDT_SCB       *p_scb = &avdt_cb.scb[0];
     UINT8           err_code = AVDT_ERR_CONNECT;
+    UNUSED(p_data);
 
     /* clear the ccb */
     avdt_ccb_clear_ccb(p_ccb);
@@ -754,6 +761,8 @@
 *******************************************************************************/
 void avdt_ccb_free_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     if (p_ccb->p_curr_cmd != NULL)
     {
         GKI_freebuf(p_ccb->p_curr_cmd);
@@ -838,6 +847,7 @@
 void avdt_ccb_snd_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
     BT_HDR  *p_msg;
+    UNUSED(p_data);
 
     /* do we have commands to send?  send next command;  make sure we're clear;
     ** not congested, not sending fragment, not waiting for response
@@ -870,6 +880,7 @@
 void avdt_ccb_snd_msg(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
     BT_HDR      *p_msg;
+    UNUSED(p_data);
 
     /* if not congested */
     if (!p_ccb->cong)
@@ -911,6 +922,8 @@
 *******************************************************************************/
 void avdt_ccb_set_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     p_ccb->reconn = TRUE;
 }
 
@@ -926,6 +939,8 @@
 *******************************************************************************/
 void avdt_ccb_clr_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     p_ccb->reconn = FALSE;
 }
 
@@ -944,6 +959,7 @@
 void avdt_ccb_chk_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
     UINT8   err_code = AVDT_ERR_CONNECT;
+    UNUSED(p_data);
 
     if (p_ccb->reconn)
     {
@@ -977,6 +993,8 @@
 *******************************************************************************/
 void avdt_ccb_chk_timer(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     if (p_ccb->timer_entry.event == BTU_TTYPE_AVDT_CCB_IDLE)
     {
         btu_stop_timer(&p_ccb->timer_entry);
@@ -1036,6 +1054,8 @@
 *******************************************************************************/
 void avdt_ccb_do_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     /* clear any pending commands */
     avdt_ccb_clear_cmds(p_ccb, NULL);
 
@@ -1058,6 +1078,7 @@
     tAVDT_CTRL_CBACK    *p_cback;
     BD_ADDR             bd_addr;
     tAVDT_CTRL          avdt_ctrl;
+    UNUSED(p_data);
 
     /* clear any pending commands */
     avdt_ccb_clear_cmds(p_ccb, NULL);
diff --git a/stack/avdt/avdt_l2c.c b/stack/avdt/avdt_l2c.c
index 20979b4..2256a90 100644
--- a/stack/avdt/avdt_l2c.c
+++ b/stack/avdt/avdt_l2c.c
@@ -25,6 +25,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -74,6 +75,7 @@
     tAVDT_CCB       *p_ccb = NULL;
     tL2CAP_CFG_INFO cfg;
     tAVDT_TC_TBL    *p_tbl;
+    UNUSED(p_ref_data);
 
     AVDT_TRACE_DEBUG1("avdt_sec_check_complete_term res: %d", res);
     if (!bd_addr)
@@ -130,6 +132,7 @@
     tAVDT_CCB       *p_ccb = NULL;
     tL2CAP_CFG_INFO cfg;
     tAVDT_TC_TBL    *p_tbl;
+    UNUSED(p_ref_data);
 
     AVDT_TRACE_DEBUG1("avdt_sec_check_complete_orig res: %d", res);
     if (bd_addr)
@@ -174,6 +177,7 @@
     UINT16          result;
     tL2CAP_CFG_INFO cfg;
     tBTM_STATUS rc;
+    UNUSED(psm);
 
     /* do we already have a control channel for this peer? */
     if ((p_ccb = avdt_ccb_by_bd(bd_addr)) == NULL)
diff --git a/stack/avdt/avdt_msg.c b/stack/avdt/avdt_msg.c
index e3e4c98..7b18424 100644
--- a/stack/avdt/avdt_msg.c
+++ b/stack/avdt/avdt_msg.c
@@ -29,6 +29,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -373,6 +374,8 @@
 *******************************************************************************/
 static void avdt_msg_bld_none(UINT8 **p, tAVDT_MSG *p_msg)
 {
+    UNUSED(p);
+    UNUSED(p_msg);
     return;
 }
 
@@ -775,6 +778,9 @@
 *******************************************************************************/
 static UINT8 avdt_msg_prs_none(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len)
 {
+    UNUSED(p_msg);
+    UNUSED(p);
+    UNUSED(len);
     return 0;
 }
 
diff --git a/stack/avdt/avdt_scb.c b/stack/avdt/avdt_scb.c
index 0536d91..d0c9e0f 100644
--- a/stack/avdt/avdt_scb.c
+++ b/stack/avdt/avdt_scb.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -647,6 +648,7 @@
 #if AVDT_MULTIPLEXING == TRUE
     void *p_buf;
 #endif
+    UNUSED(p_data);
 
     AVDT_TRACE_DEBUG1("avdt_scb_dealloc hdl=%d", avdt_scb_to_hdl(p_scb));
     btu_stop_timer(&p_scb->timer_entry);
diff --git a/stack/avdt/avdt_scb_act.c b/stack/avdt/avdt_scb_act.c
index 66f9b7d..8175b96 100644
--- a/stack/avdt/avdt_scb_act.c
+++ b/stack/avdt/avdt_scb_act.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "data_types.h"
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "avdt_api.h"
 #include "avdtc_api.h"
 #include "avdt_int.h"
@@ -103,6 +104,8 @@
 *******************************************************************************/
 void avdt_scb_hdl_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+    UNUSED(p_data);
     return;
 }
 
@@ -167,6 +170,8 @@
 *******************************************************************************/
 void avdt_scb_hdl_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+    UNUSED(p_data);
     return;
 }
 
@@ -215,6 +220,8 @@
 *******************************************************************************/
 void avdt_scb_hdl_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     /* initiate opening of trans channels for this SEID */
     p_scb->role = AVDT_OPEN_INT;
     avdt_ad_open_req(AVDT_CHAN_MEDIA, p_scb->p_ccb, p_scb, AVDT_INT);
@@ -668,6 +675,8 @@
 *******************************************************************************/
 void avdt_scb_drop_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+
     GKI_freebuf(p_data->p_pkt);
     AVDT_TRACE_WARNING0("Dropped incoming media packet");
 }
@@ -874,6 +883,7 @@
 void avdt_scb_hdl_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_EVT_HDR   single;
+    UNUSED(p_data);
 
     if (p_scb->p_ccb != NULL)
     {
@@ -898,6 +908,8 @@
 *******************************************************************************/
 void avdt_scb_hdl_start_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     (*p_scb->cs.p_ctrl_cback)(avdt_scb_to_hdl(p_scb),
                               p_scb->p_ccb ? p_scb->p_ccb->peer_addr : NULL,
                               AVDT_START_IND_EVT,
@@ -934,6 +946,8 @@
 *******************************************************************************/
 void avdt_scb_hdl_suspend_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     (*p_scb->cs.p_ctrl_cback)(avdt_scb_to_hdl(p_scb),
                               p_scb->p_ccb ? p_scb->p_ccb->peer_addr : NULL,
                               AVDT_SUSPEND_IND_EVT,
@@ -1344,6 +1358,7 @@
 void avdt_scb_snd_abort_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_EVT_HDR   hdr;
+    UNUSED(p_data);
 
     if (p_scb->p_ccb != NULL)
     {
@@ -1366,6 +1381,8 @@
 *******************************************************************************/
 void avdt_scb_snd_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+
     avdt_msg_send_rsp(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx), AVDT_SIG_ABORT,
                       &p_data->msg);
 }
@@ -1382,6 +1399,7 @@
 void avdt_scb_snd_close_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_EVT_HDR   hdr;
+    UNUSED(p_data);
 
     p_scb->role = AVDT_CLOSE_INT;
 
@@ -1452,6 +1470,7 @@
 void avdt_scb_snd_getconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_EVT_HDR   hdr;
+    UNUSED(p_data);
 
     hdr.seid = p_scb->peer_seid;
 
@@ -1484,6 +1503,7 @@
 void avdt_scb_snd_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_EVT_HDR   hdr;
+    UNUSED(p_data);
 
     hdr.seid = p_scb->peer_seid;
 
@@ -1696,6 +1716,8 @@
 *******************************************************************************/
 void avdt_scb_snd_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
 #if AVDT_REPORTING == TRUE
     if(p_scb->curr_cfg.psc_mask & AVDT_PSC_REPORT)
         avdt_ad_close_req(AVDT_CHAN_REPORT, p_scb->p_ccb, p_scb);
@@ -1716,6 +1738,7 @@
 void avdt_scb_cb_err(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
     tAVDT_CTRL          avdt_ctrl;
+    UNUSED(p_data);
 
     /* set error code and parameter */
     avdt_ctrl.hdr.err_code = AVDT_ERR_BAD_STATE;
@@ -1755,6 +1778,8 @@
 *******************************************************************************/
 void avdt_scb_rej_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+
     p_data->msg.hdr.err_code = AVDT_ERR_BAD_STATE;
     p_data->msg.hdr.err_param = 0;
     avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1773,6 +1798,8 @@
 *******************************************************************************/
 void avdt_scb_rej_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+
     p_data->msg.hdr.err_code = AVDT_ERR_IN_USE;
     p_data->msg.hdr.err_param = 0;
     avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1791,6 +1818,8 @@
 *******************************************************************************/
 void avdt_scb_rej_not_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_scb);
+
     p_data->msg.hdr.err_code = AVDT_ERR_NOT_IN_USE;
     p_data->msg.hdr.err_param = 0;
     avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1808,6 +1837,8 @@
 *******************************************************************************/
 void avdt_scb_set_remove(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     p_scb->remove = TRUE;
 }
 
@@ -1866,6 +1897,7 @@
 #if AVDT_MULTIPLEXING == TRUE
     BT_HDR          *p_frag;
 #endif
+    UNUSED(p_data);
 
     /* set error code and parameter */
     avdt_ctrl.hdr.err_code = AVDT_ERR_BAD_STATE;
@@ -1930,6 +1962,7 @@
     UINT8   res = AVDT_AD_SUCCESS;
     tAVDT_SCB_EVT data;
 #endif
+    UNUSED(p_data);
 
     avdt_ctrl.hdr.err_code = 0;
 
@@ -2003,6 +2036,8 @@
 *******************************************************************************/
 void avdt_scb_tc_timer(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     btu_start_timer(&p_scb->timer_entry, BTU_TTYPE_AVDT_SCB_TC, AVDT_SCB_TC_DISC_TOUT);
 }
 
@@ -2017,6 +2052,8 @@
 *******************************************************************************/
 void avdt_scb_clr_vars(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     p_scb->in_use = FALSE;
     p_scb->p_ccb = NULL;
     p_scb->peer_seid = 0;
diff --git a/stack/avrc/avrc_bld_tg.c b/stack/avrc/avrc_bld_tg.c
index d201b9d..6fe645a 100755
--- a/stack/avrc/avrc_bld_tg.c
+++ b/stack/avrc/avrc_bld_tg.c
@@ -21,6 +21,7 @@
 #include "avrc_api.h"
 #include "avrc_defs.h"
 #include "avrc_int.h"
+#include "bt_utils.h"
 
 /*****************************************************************************
 **  Global data
@@ -276,6 +277,9 @@
 *******************************************************************************/
 static tAVRC_STS avrc_bld_set_app_setting_value_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
 {
+    UNUSED(p_rsp);
+    UNUSED(p_pkt);
+
     /* nothing to be added. */
     AVRC_TRACE_API0("avrc_bld_set_app_setting_value_rsp");
     return AVRC_STS_NO_ERROR;
@@ -401,6 +405,9 @@
 *******************************************************************************/
 static tAVRC_STS avrc_bld_inform_charset_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
 {
+    UNUSED(p_rsp);
+    UNUSED(p_pkt);
+
     /* nothing to be added. */
     AVRC_TRACE_API0("avrc_bld_inform_charset_rsp");
     return AVRC_STS_NO_ERROR;
@@ -419,6 +426,9 @@
 *******************************************************************************/
 static tAVRC_STS avrc_bld_inform_battery_status_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
 {
+    UNUSED(p_rsp);
+    UNUSED(p_pkt);
+
     /* nothing to be added. */
     AVRC_TRACE_API0("avrc_bld_inform_battery_status_rsp");
     return AVRC_STS_NO_ERROR;
@@ -653,6 +663,9 @@
 *******************************************************************************/
 static tAVRC_STS avrc_bld_next_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
 {
+    UNUSED(p_rsp);
+    UNUSED(p_pkt);
+
     /* nothing to be added. */
     AVRC_TRACE_API0("avrc_bld_next_rsp");
     return AVRC_STS_NO_ERROR;
@@ -800,6 +813,7 @@
     tAVRC_STS status = AVRC_STS_BAD_PARAM;
     BT_HDR *p_pkt;
     BOOLEAN alloc = FALSE;
+    UNUSED(handle);
 
     if (!p_rsp || !pp_pkt)
     {
diff --git a/stack/avrc/avrc_pars_ct.c b/stack/avrc/avrc_pars_ct.c
index 85a9233..f3b4af5 100755
--- a/stack/avrc/avrc_pars_ct.c
+++ b/stack/avrc/avrc_pars_ct.c
@@ -21,6 +21,7 @@
 #include "avrc_api.h"
 #include "avrc_defs.h"
 #include "avrc_int.h"
+#include "bt_utils.h"
 
 /*****************************************************************************
 **  Global data
@@ -39,7 +40,7 @@
 **                  Otherwise, the error code defined by AVRCP 1.4
 **
 *******************************************************************************/
-static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p_result, UINT8 *p_buf, UINT16 buf_len)
+static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p_result)
 {
     tAVRC_STS  status = AVRC_STS_NO_ERROR;
     UINT8   *p = p_msg->p_vendor_data;
@@ -117,13 +118,15 @@
 {
     tAVRC_STS  status = AVRC_STS_INTERNAL_ERR;
     UINT16  id;
+    UNUSED(p_buf);
+    UNUSED(buf_len);
 
     if (p_msg && p_result)
     {
         switch (p_msg->hdr.opcode)
         {
         case AVRC_OP_VENDOR:     /*  0x00    Vendor-dependent commands */
-            status = avrc_pars_vendor_rsp(&p_msg->vendor, p_result, p_buf, buf_len);
+            status = avrc_pars_vendor_rsp(&p_msg->vendor, p_result);
             break;
 
         case AVRC_OP_PASS_THRU:  /*  0x7C    panel subunit opcode */
@@ -139,7 +142,7 @@
             break;
         }
         p_result->rsp.opcode = p_msg->hdr.opcode;
-    p_result->rsp.status = status;
+        p_result->rsp.status = status;
     }
     return status;
 }
diff --git a/stack/bnep/bnep_main.c b/stack/bnep/bnep_main.c
index 12c9da0..45d3b14 100644
--- a/stack/bnep/bnep_main.c
+++ b/stack/bnep/bnep_main.c
@@ -41,6 +41,7 @@
 
 #include "bnep_api.h"
 #include "bnep_int.h"
+#include "bt_utils.h"
 
 
 /********************************************************************************/
@@ -120,6 +121,7 @@
 static void bnep_connect_ind (BD_ADDR  bd_addr, UINT16 l2cap_cid, UINT16 psm, UINT8 l2cap_id)
 {
     tBNEP_CONN    *p_bcb = bnepu_find_bcb_by_bd_addr (bd_addr);
+    UNUSED(psm);
 
     /* If we are not acting as server, or already have a connection, or have */
     /* no more resources to handle the connection, reject the connection.    */
diff --git a/stack/bnep/bnep_utils.c b/stack/bnep/bnep_utils.c
index 205eeeb..0a8fd6d 100644
--- a/stack/bnep/bnep_utils.c
+++ b/stack/bnep/bnep_utils.c
@@ -29,6 +29,7 @@
 #include "bnep_int.h"
 #include "btu.h"
 #include "btm_int.h"
+#include "bt_utils.h"
 
 
 /********************************************************************************/
@@ -1213,6 +1214,7 @@
     tBNEP_CONN      *p_bcb = (tBNEP_CONN *)p_ref_data;
     UINT16          resp_code = BNEP_SETUP_CONN_OK;
     BOOLEAN         is_role_change;
+    UNUSED(bd_addr);
 
     BNEP_TRACE_EVENT1 ("BNEP security callback returned result %d", result);
     if (p_bcb->con_flags & BNEP_FLAGS_CONN_COMPLETED)
diff --git a/stack/btm/btm_ble.c b/stack/btm/btm_ble.c
index 6f2f454..0db65e4 100644
--- a/stack/btm/btm_ble.c
+++ b/stack/btm/btm_ble.c
@@ -33,6 +33,7 @@
 #include "smp_api.h"
 #include "l2c_int.h"
 #include "gap_api.h"
+#include "bt_utils.h"
 
 #if SMP_INCLUDED == TRUE
 extern BOOLEAN AES_CMAC ( BT_OCTET16 key, UINT8 *input, UINT16 length, UINT16 tlen, UINT8 *p_signature);
@@ -1507,6 +1508,7 @@
 {
     tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bda);
     tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
+    UNUSED(addr_matched);
 
     BTM_TRACE_EVENT0 ("btm_ble_connected");
 
@@ -1568,6 +1570,7 @@
     BD_ADDR     bda;
     UINT16      conn_interval, conn_latency, conn_timeout;
     BOOLEAN     match = FALSE;
+    UNUSED(evt_len);
 
     STREAM_TO_UINT8   (status, p);
     STREAM_TO_UINT16   (handle, p);
diff --git a/stack/btm/btm_ble_bgconn.c b/stack/btm/btm_ble_bgconn.c
index 727390c..96d35c4 100644
--- a/stack/btm/btm_ble_bgconn.c
+++ b/stack/btm/btm_ble_bgconn.c
@@ -29,7 +29,7 @@
 #include "btm_int.h"
 #include "l2c_int.h"
 #include "hcimsgs.h"
-
+#include "bt_utils.h"
 
 #ifndef BTM_BLE_SCAN_PARAM_TOUT
 #define BTM_BLE_SCAN_PARAM_TOUT      50    /* 50 seconds */
@@ -73,6 +73,7 @@
     BOOLEAN             started = FALSE;
     BD_ADDR             dummy_bda = {0};
     tBT_DEVICE_TYPE dev_type;
+    UNUSED(attr);
 
     if (p_dev_rec != NULL &&
         p_dev_rec->device_type == BT_DEVICE_TYPE_BLE)
@@ -227,6 +228,8 @@
 {
     tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
     UINT8       status;
+    UNUSED(evt_len);
+
     BTM_TRACE_EVENT0 ("btm_ble_clear_white_list_complete");
     STREAM_TO_UINT8  (status, p_data);
 
@@ -259,6 +262,8 @@
 void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len)
 {
     tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
+    UNUSED(evt_len);
+
     BTM_TRACE_EVENT0 ("btm_ble_remove_from_white_list_complete");
     if (*p == HCI_SUCCESS)
     {
@@ -299,6 +304,7 @@
     tBTM_LE_BG_CONN_DEV     *p_bg_dev = &p_cb->bg_dev_list[0], *p_next, *p_cur;
     UINT8                   i, j;
     BOOLEAN             ret = FALSE;
+    UNUSED(p_attr_tag);
 
     BTM_TRACE_EVENT0 ("btm_update_bg_conn_list");
 
diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c
index bfe5fda..5e5b5db 100644
--- a/stack/btm/btm_ble_gap.c
+++ b/stack/btm/btm_ble_gap.c
@@ -27,6 +27,7 @@
 #include <stddef.h>
 
 #include "bt_types.h"
+#include "bt_utils.h"
 #include "btu.h"
 #include "btm_int.h"
 #include "hcimsgs.h"
@@ -85,7 +86,10 @@
 *******************************************************************************/
 BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda)
 {
-        return FALSE;
+    UNUSED(add_remove);
+    UNUSED(remote_bda);
+
+    return FALSE;
 }
 
 /*******************************************************************************
@@ -279,6 +283,8 @@
         tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
         p_cb->p_scan_req_cback = p_scan_req_cback;
     }
+#else
+    UNUSED(p_scan_req_cback);
 #endif
 }
 
@@ -1391,6 +1397,7 @@
     tBTM_BLE_INQ_CB     *p_le_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
     UINT8 *p_cache;
     UINT8 length;
+    UNUSED(p_cur);
 
     /* cache adv report/scan response data */
     if (evt_type != BTM_BLE_SCAN_RSP_EVT)
@@ -1619,6 +1626,7 @@
 {
     UINT8   data_len, len;
     UINT8   *p_dev_name, remname[31] = {0};
+    UNUSED(addr_type);
 
     if (btm_cb.ble_ctr_cb.p_select_cback == NULL ||
         /* non-connectable device */
@@ -2032,6 +2040,8 @@
     tACL_CONN   *pa = &btm_cb.acl_db[0];
     UINT16       xx;
     UINT8        dev_role = link_role;
+    UNUSED(bd_addr);
+    UNUSED(conn_cancel);
 
     BTM_TRACE_DEBUG1("btm_ble_update_mode_operation adv_mode = %d", btm_cb.ble_ctr_cb.inq_var.adv_mode );
 
diff --git a/stack/btm/btm_devctl.c b/stack/btm/btm_devctl.c
index 64c821a..240bd2f 100644
--- a/stack/btm/btm_devctl.c
+++ b/stack/btm/btm_devctl.c
@@ -29,6 +29,7 @@
 #include <stddef.h>
 
 #include "bt_types.h"
+#include "bt_utils.h"
 #include "hcimsgs.h"
 #include "btu.h"
 #include "btm_int.h"
@@ -729,6 +730,7 @@
     UINT16      lm_num_acl_bufs;
     UINT16      lm_num_sco_bufs;
     UINT16      acl_buf_size;
+    UNUSED(evt_len);
 
     STREAM_TO_UINT8  (status, p);
     if (status == HCI_SUCCESS)
@@ -790,8 +792,9 @@
 {
     UINT8       status;
     UINT16      lm_num_le_bufs;
+    UNUSED(evt_len);
 
-     BTM_TRACE_DEBUG0("btm_read_ble_buf_size_complete ");
+    BTM_TRACE_DEBUG0("btm_read_ble_buf_size_complete ");
     STREAM_TO_UINT8  (status, p);
     if (status == HCI_SUCCESS)
     {
@@ -823,6 +826,7 @@
 void btm_read_ble_local_supported_features_complete (UINT8 *p, UINT16 evt_len)
 {
     UINT8       status;
+    UNUSED(evt_len);
 
     BTM_TRACE_DEBUG0("btm_read_ble_local_supported_features_complete ");
 
@@ -860,8 +864,9 @@
 void btm_read_white_list_size_complete(UINT8 *p, UINT16 evt_len)
 {
     UINT8       status;
+    UNUSED(evt_len);
 
-     BTM_TRACE_DEBUG0("btm_read_white_list_size_complete ");
+    BTM_TRACE_DEBUG0("btm_read_white_list_size_complete ");
     STREAM_TO_UINT8  (status, p);
 
     if (status == HCI_SUCCESS)
@@ -888,6 +893,7 @@
 {
     tBTM_VERSION_INFO   *p_vi = &btm_cb.devcb.local_version;
     UINT8                status;
+    UNUSED(evt_len);
 
 #ifdef BTA_PRM_CHECK_FW_VER
     if(BTA_PRM_CHECK_FW_VER(p))
@@ -1326,6 +1332,7 @@
 {
     tBTM_DEVCB     *p_devcb = &btm_cb.devcb;
     UINT8           status;
+    UNUSED(evt_len);
 
     btu_stop_timer (&p_devcb->reset_timer);
 
@@ -1369,6 +1376,7 @@
     UINT8           status;
     UINT8           page_number;
     UINT8           page_number_max;
+    UNUSED(evt_len);
 
     btu_stop_timer (&btm_cb.devcb.reset_timer);
 
@@ -1644,6 +1652,7 @@
 {
     tBTM_CMPL_CB   *p_cb = btm_cb.devcb.p_rln_cmpl_cb;
     UINT8           status;
+    UNUSED(evt_len);
 
     btu_stop_timer (&btm_cb.devcb.rln_timer);
 
@@ -1708,6 +1717,7 @@
 void btm_read_local_addr_complete (UINT8 *p, UINT16 evt_len)
 {
     UINT8           status;
+    UNUSED(evt_len);
 
     STREAM_TO_UINT8  (status, p);
 
diff --git a/stack/btm/btm_pm.c b/stack/btm/btm_pm.c
index 925e69f..02e3a6a 100644
--- a/stack/btm/btm_pm.c
+++ b/stack/btm/btm_pm.c
@@ -40,7 +40,7 @@
 #include "btm_int.h"
 #include "l2c_int.h"
 #include "hcidefs.h"
-
+#include "bt_utils.h"
 
 #if BTM_PWR_MGR_INCLUDED == TRUE
 
@@ -923,6 +923,7 @@
     tBTM_PM_MCB *p_cb;
     tACL_CONN   *p_acl=NULL;
     UINT16      use_ssr = TRUE;
+    UNUSED(evt_len);
 
     STREAM_TO_UINT8 (status, p);
 
diff --git a/stack/btm/btm_sco.c b/stack/btm/btm_sco.c
index 3eb010c..2200b71 100644
--- a/stack/btm/btm_sco.c
+++ b/stack/btm/btm_sco.c
@@ -33,6 +33,7 @@
 #include "btm_api.h"
 #include "btm_int.h"
 #include "hcidefs.h"
+#include "bt_utils.h"
 
 #if BTM_SCO_INCLUDED == TRUE
 
@@ -93,7 +94,11 @@
                 GKI_freebuf (p_buf);
         }
     }
+#else
+    UNUSED(sco_inx);
 #endif
+#else
+    UNUSED(sco_inx);
 #endif
 }
 /*******************************************************************************
@@ -382,6 +387,8 @@
     return (status);
 
 #else
+    UNUSED(sco_inx);
+    UNUSED(p_buf);
     return (BTM_NO_RESOURCES);
 #endif
 }
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c
index e3628f8..09f41b7 100644
--- a/stack/btm/btm_sec.c
+++ b/stack/btm/btm_sec.c
@@ -28,6 +28,7 @@
 #include "btu.h"
 #include "btm_int.h"
 #include "l2c_int.h"
+#include "bt_utils.h"
 
 #if (BT_USE_TRACES == TRUE && BT_TRACE_VERBOSE == FALSE)
 /* needed for sprintf() */
@@ -432,6 +433,13 @@
     return(btm_sec_set_security_level (conn_type, p_name, service_id,
                                        sec_level, psm, mx_proto_id, mx_chan_id));
 #else
+    UNUSED(is_originator);
+    UNUSED(p_name);
+    UNUSED(service_id);
+    UNUSED(sec_level);
+    UNUSED(psm);
+    UNUSED(mx_proto_id);
+    UNUSED(mx_chan_id);
     return FALSE;
 #endif
 }
@@ -842,6 +850,7 @@
 
     return(num_cleared);
 #else
+    UNUSED(service_id);
     return(0);
 #endif
 }
@@ -4039,6 +4048,7 @@
 static void btm_sec_connect_after_reject_timeout (TIMER_LIST_ENT *p_tle)
 {
     tBTM_SEC_DEV_REC *p_dev_rec = btm_cb.p_collided_dev_rec;
+    UNUSED(p_tle);
 
     BTM_TRACE_EVENT0 ("btm_sec_connect_after_reject_timeout()");
     btm_cb.sec_collision_tle.param = 0;
@@ -4655,6 +4665,7 @@
 #endif
 #endif
     UINT8   name[2];
+    UNUSED(p_tle);
 
     p_cb->pairing_tle.param = 0;
 /* Coverity: FALSE-POSITIVE error from Coverity tool. Please do NOT remove following comment. */
@@ -5357,6 +5368,7 @@
 static void btm_sec_collision_timeout (TIMER_LIST_ENT *p_tle)
 {
     tBTM_STATUS status;
+    UNUSED(p_tle);
 
     BTM_TRACE_EVENT0 ("btm_sec_collision_timeout()");
     btm_cb.sec_collision_tle.param = 0;
diff --git a/stack/btu/btu_task.c b/stack/btu/btu_task.c
index da9a54d..9c09214 100644
--- a/stack/btu/btu_task.c
+++ b/stack/btu/btu_task.c
@@ -166,6 +166,7 @@
     UINT8            i;
     UINT16           mask;
     BOOLEAN          handled;
+    UNUSED(param);
 
 #if (defined(HCISU_H4_INCLUDED) && HCISU_H4_INCLUDED == TRUE)
     /* wait an event that HCISU is ready */
diff --git a/stack/gap/gap_api.c b/stack/gap/gap_api.c
index d17895d..fb90d03 100644
--- a/stack/gap/gap_api.c
+++ b/stack/gap/gap_api.c
@@ -19,6 +19,7 @@
 #include <string.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gap_int.h"
 #include "btm_int.h"
 #include "gki.h"
@@ -683,6 +684,10 @@
 UINT16 GAP_ReadLocalDeviceInfo(UINT8 *name, BD_ADDR *addr, tGAP_LMP_VERSION *verinfo,
                                tGAP_LMP_FEATURES *features)
 {
+    UNUSED(name);
+    UNUSED(addr);
+    UNUSED(verinfo);
+    UNUSED(features);
     return (GAP_UNSUPPORTED);
 }
 
diff --git a/stack/gap/gap_ble.c b/stack/gap/gap_ble.c
index 48f4723..d44577d 100644
--- a/stack/gap/gap_ble.c
+++ b/stack/gap/gap_ble.c
@@ -19,6 +19,7 @@
 
 #if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
 
+#include "bt_utils.h"
 #include <string.h>
 #include "gap_int.h"
 #include "gap_api.h"
@@ -345,6 +346,7 @@
 tGATT_STATUS gap_proc_read (tGATTS_REQ_TYPE type, tGATT_READ_REQ *p_data, tGATTS_RSP *p_rsp)
 {
     tGATT_STATUS    status = GATT_NO_RESOURCES;
+    UNUSED(type);
 
     if (p_data->is_long)
         p_rsp->attr_value.offset = p_data->offset;
@@ -381,6 +383,7 @@
 {
     tGAP_ATTR   *p_db_attr = gap_cb.gatt_attr;
     UINT8   i;
+    UNUSED(type);
 
     for (i = 0; i < GAP_MAX_CHAR_NUM; i ++, p_db_attr ++)
     {
@@ -613,6 +616,7 @@
 {
     tGAP_CLCB   *p_clcb = gap_find_clcb_by_bd_addr (bda);
     UINT16      cl_op_uuid;
+    UNUSED(gatt_if);
 
     GAP_TRACE_EVENT5 ("gap_ble_c_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
                       (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
diff --git a/stack/gap/gap_conn.c b/stack/gap/gap_conn.c
index 43765b7..44bb5ec 100644
--- a/stack/gap/gap_conn.c
+++ b/stack/gap/gap_conn.c
@@ -18,6 +18,7 @@
 
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "btu.h"
 #include "gap_int.h"
 #include "l2cdefs.h"
@@ -801,6 +802,7 @@
 static void gap_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
 {
     tGAP_CCB *p_ccb = (tGAP_CCB *)p_ref_data;
+    UNUSED(bd_addr);
 
     GAP_TRACE_EVENT3 ("gap_sec_check_complete conn_state:%d, conn_flags:0x%x, status:%d",
         p_ccb->con_state, p_ccb->con_flags, res);
diff --git a/stack/gap/gap_utils.c b/stack/gap/gap_utils.c
index d253a99..866ad7a 100644
--- a/stack/gap/gap_utils.c
+++ b/stack/gap/gap_utils.c
@@ -18,6 +18,7 @@
 
 #include <string.h>
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gap_int.h"
 
 /*****************************************************************************/
@@ -116,6 +117,7 @@
 {
     tGAP_INFO   *p_cb;
     UINT8        index;
+    UNUSED(p_eir);
 
     GAP_TRACE_EVENT6 ("GAP Inquiry Results Callback (bdaddr [%02x%02x%02x%02x%02x%02x])",
                 p_results->remote_bd_addr[0], p_results->remote_bd_addr[1],
@@ -305,6 +307,8 @@
 
     return (GAP_EOINQDB);
 #else
+    UNUSED(devname);
+    UNUSED(bd_addr);
     /* No data available because we are not automatically saving the data */
     return (GAP_NO_DATA_AVAIL);
 #endif
diff --git a/stack/gatt/gatt_attr.c b/stack/gatt/gatt_attr.c
index 9af6a60..1ee4ae3 100644
--- a/stack/gatt/gatt_attr.c
+++ b/stack/gatt/gatt_attr.c
@@ -24,6 +24,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #include "gatt_api.h"
 #include "gatt_int.h"
@@ -216,6 +217,8 @@
 static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
                                         BOOLEAN connected, tGATT_DISCONN_REASON reason)
 {
+    UNUSED(gatt_if);
+
     GATT_TRACE_EVENT5 ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
                        (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
                        (bda[4]<<8)+bda[5], connected, conn_id, reason);
diff --git a/stack/gatt/gatt_auth.c b/stack/gatt/gatt_auth.c
index e945c90..7dc99e1 100644
--- a/stack/gatt/gatt_auth.c
+++ b/stack/gatt/gatt_auth.c
@@ -22,6 +22,7 @@
  *
  ******************************************************************************/
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #if BLE_INCLUDED == TRUE
 #include <string.h>
@@ -163,6 +164,7 @@
     BOOLEAN     status = FALSE;
     tGATT_PENDING_ENC_CLCB  *p_buf;
     UINT16       count;
+    UNUSED(p_ref_data);
 
     GATT_TRACE_DEBUG0("gatt_enc_cmpl_cback");
     if ((p_tcb = gatt_find_tcb_by_addr(bd_addr)) != NULL)
diff --git a/stack/gatt/gatt_main.c b/stack/gatt/gatt_main.c
index 50522ac..d5e017b 100644
--- a/stack/gatt/gatt_main.c
+++ b/stack/gatt/gatt_main.c
@@ -31,6 +31,7 @@
 #include "l2c_api.h"
 #include "btm_int.h"
 #include "btm_ble_int.h"
+#include "bt_utils.h"
 
 /* Configuration flags. */
 #define GATT_L2C_CFG_IND_DONE   (1<<0)
@@ -508,6 +509,7 @@
     UINT8       result = L2CAP_CONN_OK;
     tL2CAP_CFG_INFO cfg;
     tGATT_TCB       *p_tcb = gatt_find_tcb_by_addr(bd_addr);
+    UNUSED(psm);
 
     GATT_TRACE_ERROR1("Connection indication cid = %d", lcid);
     /* new connection ? */
@@ -767,6 +769,7 @@
 {
     tGATT_TCB       *p_tcb;
     UINT16          reason;
+    UNUSED(result);
 
     /* look up clcb for this channel */
     if ((p_tcb = gatt_find_tcb_by_cid(lcid)) != NULL)
diff --git a/stack/gatt/gatt_sr.c b/stack/gatt/gatt_sr.c
index 6817283..88040fe 100644
--- a/stack/gatt/gatt_sr.c
+++ b/stack/gatt/gatt_sr.c
@@ -23,6 +23,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #if BLE_INCLUDED == TRUE
 #include <string.h>
@@ -262,6 +263,7 @@
                                       tGATT_STATUS status, tGATTS_RSP *p_msg)
 {
     tGATT_STATUS    ret_code = GATT_SUCCESS;
+    UNUSED(trans_id);
 
     GATT_TRACE_DEBUG1("gatt_sr_process_app_rsp gatt_if=%d", gatt_if);
 
@@ -326,7 +328,7 @@
 ** Returns          void
 **
 *******************************************************************************/
-void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
+static void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT8 *p_data)
 {
     UINT8   *p = p_data, flag, i = 0;
     UINT32  trans_id = 0;
@@ -525,7 +527,7 @@
 *******************************************************************************/
 static tGATT_STATUS gatt_build_primary_service_rsp (BT_HDR *p_msg, tGATT_TCB *p_tcb,
                                                     UINT8 op_code, UINT16 s_hdl,
-                                                    UINT16 e_hdl, UINT8 *p_data, tBT_UUID value)
+                                                    UINT16 e_hdl, tBT_UUID value)
 {
     tGATT_STATUS    status = GATT_NOT_FOUND;
     UINT8           handle_len =4, *p ;
@@ -784,7 +786,7 @@
                 else
                 {
                     memset(p_msg, 0, msg_len);
-                    reason = gatt_build_primary_service_rsp (p_msg, p_tcb, op_code, s_hdl, e_hdl, p_data, value);
+                    reason = gatt_build_primary_service_rsp (p_msg, p_tcb, op_code, s_hdl, e_hdl, value);
                 }
             }
         }
@@ -1169,7 +1171,7 @@
 **
 *******************************************************************************/
 static void gatts_process_read_req(tGATT_TCB *p_tcb, tGATT_SR_REG *p_rcb, UINT8 op_code,
-                                   UINT16 handle, UINT16 len, UINT8 *p_data)
+                                   UINT16 handle, UINT8 *p_data)
 {
     UINT16          buf_len = (UINT16)(sizeof(BT_HDR) + p_tcb->payload_size + L2CAP_MIN_OFFSET);
     tGATT_STATUS    reason;
@@ -1285,7 +1287,7 @@
                         {
                             case GATT_REQ_READ: /* read char/char descriptor value */
                             case GATT_REQ_READ_BLOB:
-                                gatts_process_read_req(p_tcb, p_rcb, op_code, handle, len, p);
+                                gatts_process_read_req(p_tcb, p_rcb, op_code, handle, p);
                                 break;
 
                             case GATT_REQ_WRITE: /* write char/char descriptor value */
@@ -1502,7 +1504,7 @@
                 break;
 
             case GATT_REQ_EXEC_WRITE:
-                gatt_process_exec_write_req (p_tcb, op_code, len, p_data);
+                gatt_process_exec_write_req (p_tcb, op_code, p_data);
                 break;
 
             case GATT_REQ_READ_MULTI:
diff --git a/stack/gatt/gatt_utils.c b/stack/gatt/gatt_utils.c
index e15918c..7ce77eb 100644
--- a/stack/gatt/gatt_utils.c
+++ b/stack/gatt/gatt_utils.c
@@ -22,6 +22,7 @@
  *
  ******************************************************************************/
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #if BLE_INCLUDED == TRUE
     #include <string.h>
@@ -477,6 +478,8 @@
 *******************************************************************************/
 void gatts_update_srv_list_elem(UINT8 i_sreg, UINT16 handle, BOOLEAN is_primary)
 {
+    UNUSED(handle);
+
     gatt_cb.srv_list[i_sreg].in_use         = TRUE;
     gatt_cb.srv_list[i_sreg].i_sreg    = i_sreg;
     gatt_cb.srv_list[i_sreg].s_hdl          = gatt_cb.sr_reg[i_sreg].s_hdl;
@@ -1299,6 +1302,7 @@
 void gatt_sr_get_sec_info(BD_ADDR rem_bda, BOOLEAN le_conn, UINT8 *p_sec_flag, UINT8 *p_key_size)
 {
     UINT8           sec_flag = 0;
+    UNUSED(le_conn);
 
     BTM_GetSecurityFlags(rem_bda, &sec_flag);
 
diff --git a/stack/hid/hidh_conn.c b/stack/hid/hidh_conn.c
index d9345a0..86b41d3 100644
--- a/stack/hid/hidh_conn.c
+++ b/stack/hid/hidh_conn.c
@@ -41,6 +41,7 @@
 
 #include "hidh_api.h"
 #include "hidh_int.h"
+#include "bt_utils.h"
 
 static UINT8 find_conn_by_cid (UINT16 cid);
 static void hidh_conn_retry (UINT8 dhandle);
@@ -163,6 +164,7 @@
 void hidh_sec_check_complete_term (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
 {
     tHID_HOST_DEV_CTB *p_dev= (tHID_HOST_DEV_CTB *) p_ref_data;
+    UNUSED(bd_addr);
 
     if( res == BTM_SUCCESS && p_dev->conn.conn_state == HID_CONN_STATE_SECURITY )
     {
@@ -320,6 +322,7 @@
     UINT32 cb_res = HID_ERR_AUTH_FAILED;
 #endif
     UINT32 reason;
+    UNUSED(bd_addr);
 
     dhandle = ((UINT32)p_dev - (UINT32)&(hh_cb.devices[0]))/ sizeof(tHID_HOST_DEV_CTB);
     if( res == BTM_SUCCESS && p_dev->conn.conn_state == HID_CONN_STATE_SECURITY )
@@ -654,6 +657,7 @@
 {
     UINT8 dhandle;
     tHID_CONN    *p_hcon = NULL;
+    UNUSED(result);
 
     /* Find CCB based on CID */
     if( (dhandle = find_conn_by_cid(l2cap_cid)) < HID_HOST_MAX_DEVICES )
diff --git a/stack/l2cap/l2c_ble.c b/stack/l2cap/l2c_ble.c
index a440492..2f2646e 100644
--- a/stack/l2cap/l2c_ble.c
+++ b/stack/l2cap/l2c_ble.c
@@ -24,6 +24,7 @@
 
 #include <string.h>
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "l2cdefs.h"
 #include "l2c_int.h"
 #include "btu.h"
@@ -426,6 +427,10 @@
 {
     tL2C_LCB            *p_lcb;
     tBTM_SEC_DEV_REC    *p_dev_rec;
+    UNUSED(type);
+    UNUSED(conn_interval);
+    UNUSED(conn_latency);
+    UNUSED(conn_timeout);
 
     /* See if we have a link control block for the remote device */
     p_lcb = l2cu_find_lcb_by_bd_addr (bda);
diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c
index ca563d9..fd38ca2 100644
--- a/stack/l2cap/l2c_link.c
+++ b/stack/l2cap/l2c_link.c
@@ -30,6 +30,7 @@
 
 #include "gki.h"
 #include "bt_types.h"
+#include "bt_utils.h"
 #include "hcimsgs.h"
 #include "l2cdefs.h"
 #include "l2c_int.h"
@@ -949,7 +950,9 @@
             num_found++;
         }
     }
-
+#else
+    UNUSED(num_pkts);
+    UNUSED(handles);
 #endif
 
     return (num_found);
diff --git a/stack/mcap/mca_cact.c b/stack/mcap/mca_cact.c
index 85f19f4..16a8cec 100644
--- a/stack/mcap/mca_cact.c
+++ b/stack/mcap/mca_cact.c
@@ -24,6 +24,7 @@
  ******************************************************************************/
 #include <string.h>
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gki.h"
 #include "btm_api.h"
 #include "mca_api.h"
@@ -47,6 +48,8 @@
 void mca_ccb_rsp_tout(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
 {
    tMCA_CTRL   evt_data;
+   UNUSED(p_data);
+
    mca_ccb_report_event(p_ccb, MCA_RSP_TOUT_IND_EVT, &evt_data);
 }
 
@@ -76,6 +79,8 @@
 *******************************************************************************/
 void mca_ccb_free_msg(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
 {
+    UNUSED(p_ccb);
+
     GKI_freebuf (p_data);
 }
 
@@ -210,6 +215,8 @@
 *******************************************************************************/
 void mca_ccb_do_disconn (tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     mca_dcb_close_by_mdl_id (p_ccb, MCA_ALL_MDL_ID);
     L2CA_DisconnectReq(p_ccb->lcid);
 }
@@ -573,6 +580,8 @@
 *******************************************************************************/
 void mca_ccb_dl_open (tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
 {
+    UNUSED(p_data);
+
     mca_free_buf ((void **)&p_ccb->p_tx_req);
     mca_free_buf ((void **)&p_ccb->p_rx_msg);
     p_ccb->status = MCA_CCB_STAT_NORM;
diff --git a/stack/mcap/mca_dact.c b/stack/mcap/mca_dact.c
index 353153eb..d147c39 100644
--- a/stack/mcap/mca_dact.c
+++ b/stack/mcap/mca_dact.c
@@ -23,6 +23,7 @@
  *
  ******************************************************************************/
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gki.h"
 #include "mca_api.h"
 #include "mca_int.h"
@@ -99,6 +100,8 @@
 *******************************************************************************/
 void mca_dcb_free_data (tMCA_DCB *p_dcb, tMCA_DCB_EVT *p_data)
 {
+    UNUSED(p_dcb);
+
     GKI_freebuf (p_data);
 }
 
@@ -114,6 +117,8 @@
 void mca_dcb_do_disconn (tMCA_DCB *p_dcb, tMCA_DCB_EVT *p_data)
 {
     tMCA_CLOSE  close;
+    UNUSED(p_data);
+
     if ((p_dcb->lcid == 0) || (L2CA_DisconnectReq(p_dcb->lcid) == FALSE))
     {
         close.param  = MCA_INT;
diff --git a/stack/mcap/mca_l2c.c b/stack/mcap/mca_l2c.c
index 23d56f5..bc6fe09 100644
--- a/stack/mcap/mca_l2c.c
+++ b/stack/mcap/mca_l2c.c
@@ -24,6 +24,7 @@
 #include <string.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "btm_api.h"
 #include "btm_int.h"
 #include "mca_api.h"
@@ -118,6 +119,7 @@
 {
     tMCA_TC_TBL     *p_tbl = (tMCA_TC_TBL *)p_ref_data;
     tL2CAP_CFG_INFO cfg;
+    UNUSED(bd_addr);
 
     MCA_TRACE_DEBUG1("mca_sec_check_complete_orig res: %d", res);
 
diff --git a/stack/pan/pan_main.c b/stack/pan/pan_main.c
index 6cbe1ce..bfaced6 100644
--- a/stack/pan/pan_main.c
+++ b/stack/pan/pan_main.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "gki.h"
 #include "bt_types.h"
+#include "bt_utils.h"
 #include "bnep_api.h"
 #include "pan_api.h"
 #include "pan_int.h"
@@ -333,6 +334,7 @@
 {
     tPAN_CONN       *pcb;
     UINT8            peer_role;
+    UNUSED(rem_bda);
 
     PAN_TRACE_EVENT2 ("pan_connect_state_cb - for handle %d, result %d", handle, result);
     pcb = pan_get_pcb_by_handle (handle);
diff --git a/stack/rfcomm/port_rfc.c b/stack/rfcomm/port_rfc.c
index 3f697e1..003cbb5 100644
--- a/stack/rfcomm/port_rfc.c
+++ b/stack/rfcomm/port_rfc.c
@@ -32,6 +32,7 @@
 #include "btm_api.h"
 #include "port_int.h"
 #include "rfc_int.h"
+#include "bt_utils.h"
 
 /*
 ** Local function definitions
@@ -581,6 +582,7 @@
 void PORT_PortNegCnf (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars, UINT16 result)
 {
     tPORT  *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+    UNUSED(p_pars);
 
     RFCOMM_TRACE_EVENT0 ("PORT_PortNegCnf");
 
@@ -682,6 +684,7 @@
 {
     tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
     UINT32 event = 0;
+    UNUSED(p_pars);
 
     RFCOMM_TRACE_EVENT0 ("PORT_ControlCnf");
 
diff --git a/stack/rfcomm/rfc_l2cap_if.c b/stack/rfcomm/rfc_l2cap_if.c
index cb50612..9137a66 100644
--- a/stack/rfcomm/rfc_l2cap_if.c
+++ b/stack/rfcomm/rfc_l2cap_if.c
@@ -31,6 +31,7 @@
 #include "l2c_api.h"
 #include "l2cdefs.h"
 #include "rfc_int.h"
+#include "bt_utils.h"
 
 
 /*
@@ -87,6 +88,7 @@
 void RFCOMM_ConnectInd (BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id)
 {
     tRFC_MCB *p_mcb = rfc_alloc_multiplexer_channel(bd_addr, FALSE);
+    UNUSED(psm);
 
     if ((p_mcb)&&(p_mcb->state != RFC_MX_STATE_IDLE))
     {
@@ -257,6 +259,7 @@
 *******************************************************************************/
 void RFCOMM_QoSViolationInd (BD_ADDR bd_addr)
 {
+    UNUSED(bd_addr);
 }
 
 
diff --git a/stack/rfcomm/rfc_mx_fsm.c b/stack/rfcomm/rfc_mx_fsm.c
index d6bc506..6d8bb06 100644
--- a/stack/rfcomm/rfc_mx_fsm.c
+++ b/stack/rfcomm/rfc_mx_fsm.c
@@ -31,6 +31,7 @@
 #include "port_int.h"
 #include "l2c_api.h"
 #include "rfc_int.h"
+#include "bt_utils.h"
 
 #define L2CAP_SUCCESS   0
 #define L2CAP_ERROR     1
@@ -308,6 +309,8 @@
 *******************************************************************************/
 void rfc_mx_sm_sabme_wait_ua (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
 {
+    UNUSED(p_data);
+
     RFCOMM_TRACE_EVENT1 ("rfc_mx_sm_sabme_wait_ua - evt:%d", event);
     switch (event)
     {
@@ -436,6 +439,8 @@
 *******************************************************************************/
 void rfc_mx_sm_state_connected (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
 {
+    UNUSED(p_data);
+
     RFCOMM_TRACE_EVENT1 ("rfc_mx_sm_state_connected - evt:%d", event);
 
     switch (event)
diff --git a/stack/rfcomm/rfc_port_fsm.c b/stack/rfcomm/rfc_port_fsm.c
index d5335ad..e519a98 100644
--- a/stack/rfcomm/rfc_port_fsm.c
+++ b/stack/rfcomm/rfc_port_fsm.c
@@ -31,6 +31,7 @@
 #include "port_api.h"
 #include "port_int.h"
 #include "rfc_int.h"
+#include "bt_utils.h"
 
 /********************************************************************************/
 /*              L O C A L    F U N C T I O N     P R O T O T Y P E S            */
@@ -795,6 +796,8 @@
 *******************************************************************************/
 void rfc_process_nsc (tRFC_MCB *p_mcb, MX_FRAME *p_frame)
 {
+    UNUSED(p_mcb);
+    UNUSED(p_frame);
 }
 
 
@@ -808,6 +811,8 @@
 *******************************************************************************/
 void rfc_process_test_rsp (tRFC_MCB *p_mcb, BT_HDR *p_buf)
 {
+    UNUSED(p_mcb);
+
     GKI_freebuf (p_buf);
 }
 
diff --git a/stack/rfcomm/rfc_port_if.c b/stack/rfcomm/rfc_port_if.c
index 083d9ef..741df20 100644
--- a/stack/rfcomm/rfc_port_if.c
+++ b/stack/rfcomm/rfc_port_if.c
@@ -31,7 +31,7 @@
 #include "l2c_api.h"
 #include "port_int.h"
 #include "rfc_int.h"
-
+#include "bt_utils.h"
 
 #if RFC_DYNAMIC_MEMORY == FALSE
 tRFC_CB rfc_cb;
@@ -82,6 +82,7 @@
 void RFCOMM_DlcEstablishReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
 {
     tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+    UNUSED(mtu);
 
     if (p_mcb->state != RFC_MX_STATE_CONNECTED)
     {
@@ -104,6 +105,7 @@
 void RFCOMM_DlcEstablishRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 result)
 {
     tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+    UNUSED(mtu);
 
     if ((p_mcb->state != RFC_MX_STATE_CONNECTED) && (result == RFCOMM_SUCCESS))
     {
diff --git a/stack/rfcomm/rfc_utils.c b/stack/rfcomm/rfc_utils.c
index 2b850fa..d2b02fc 100644
--- a/stack/rfcomm/rfc_utils.c
+++ b/stack/rfcomm/rfc_utils.c
@@ -33,6 +33,7 @@
 #include "port_int.h"
 #include "rfc_int.h"
 #include "btu.h"
+#include "bt_utils.h"
 
 #include <string.h>
 
@@ -352,6 +353,7 @@
 void rfc_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
 {
     tPORT *p_port = (tPORT *)p_ref_data;
+    UNUSED(bd_addr);
 
     /* Verify that PORT is still waiting for Security to complete */
     if (!p_port->in_use
diff --git a/stack/sdp/sdp_api.c b/stack/sdp/sdp_api.c
index 7af690b..1471664 100644
--- a/stack/sdp/sdp_api.c
+++ b/stack/sdp/sdp_api.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gki.h"
 #include "l2cdefs.h"
 #include "hcidefs.h"
@@ -244,6 +245,8 @@
 #if SDP_CLIENT_ENABLED == TRUE
 void SDP_SetIdleTimeout (BD_ADDR addr, UINT16 timeout)
 {
+    UNUSED(addr);
+    UNUSED(timeout);
 }
 #endif
 
diff --git a/stack/sdp/sdp_main.c b/stack/sdp/sdp_main.c
index 14cd39b..d43c634 100644
--- a/stack/sdp/sdp_main.c
+++ b/stack/sdp/sdp_main.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gki.h"
 #include "l2cdefs.h"
 #include "hcidefs.h"
@@ -170,6 +171,7 @@
 *******************************************************************************/
 static void sdp_connect_ind (BD_ADDR  bd_addr, UINT16 l2cap_cid, UINT16 psm, UINT8 l2cap_id)
 {
+    UNUSED(psm);
 #if SDP_SERVER_ENABLED == TRUE
     tCONN_CB    *p_ccb;
 
@@ -671,6 +673,7 @@
 static void sdp_disconnect_cfm (UINT16 l2cap_cid, UINT16 result)
 {
     tCONN_CB    *p_ccb;
+    UNUSED(result);
 
     /* Find CCB based on CID */
     if ((p_ccb = sdpu_find_ccb_by_cid (l2cap_cid)) == NULL)
diff --git a/stack/sdp/sdp_server.c b/stack/sdp/sdp_server.c
index 342d93e..5d11cb4 100644
--- a/stack/sdp/sdp_server.c
+++ b/stack/sdp/sdp_server.c
@@ -29,6 +29,7 @@
 
 #include "gki.h"
 #include "bt_types.h"
+#include "bt_utils.h"
 #include "btu.h"
 
 #include "l2cdefs.h"
@@ -177,6 +178,7 @@
     tSDP_RECORD    *p_rec = NULL;
     BT_HDR         *p_buf;
     BOOLEAN         is_cont = FALSE;
+    UNUSED(p_req_end);
 
     p_req = sdpu_extract_uid_seq (p_req, param_len, &uid_seq);
 
@@ -565,6 +567,7 @@
     BOOLEAN         maxxed_out = FALSE, is_cont = FALSE;
     UINT8           *p_seq_start;
     UINT16          seq_len, attr_len;
+    UNUSED(p_req_end);
 
     /* Extract the UUID sequence to search for */
     p_req = sdpu_extract_uid_seq (p_req, param_len, &uid_seq);
diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c
index babd300..3370a2c 100644
--- a/stack/smp/smp_act.c
+++ b/stack/smp/smp_act.c
@@ -17,6 +17,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #if SMP_INCLUDED == TRUE
 
@@ -83,6 +84,8 @@
 {
     tSMP_EVT_DATA   cb_data;
     tSMP_STATUS callback_rc;
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG1 ("smp_send_app_cback p_cb->cb_evt=%d", p_cb->cb_evt );
     if (p_cb->p_callback && p_cb->cb_evt != 0)
     {
@@ -147,6 +150,8 @@
 void smp_send_pair_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
     tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (p_cb->pairing_bda);
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_pair_req  ");
 
 #if BLE_INCLUDED == TRUE
@@ -170,6 +175,8 @@
 *******************************************************************************/
 void smp_send_pair_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_pair_rsp  ");
 
     p_cb->loc_i_key &= p_cb->peer_i_key;
@@ -187,6 +194,8 @@
 *******************************************************************************/
 void smp_send_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_confirm  ");
     smp_send_cmd(SMP_OPCODE_CONFIRM, p_cb);
 }
@@ -196,6 +205,8 @@
 *******************************************************************************/
 void smp_send_init(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_init  ");
 
 #if SMP_CONFORMANCE_TESTING == TRUE
@@ -215,6 +226,7 @@
 void smp_send_enc_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
     tBTM_LE_LENC_KEYS   le_key;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG1 ("smp_send_enc_info  p_cb->loc_enc_size = %d", p_cb->loc_enc_size);
     smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ENC, FALSE);
@@ -238,6 +250,8 @@
 *******************************************************************************/
 void smp_send_id_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_id_info  ");
     smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ID, FALSE);
 
@@ -255,6 +269,8 @@
 void smp_send_csrk_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
     tBTM_LE_KEY_VALUE   key;
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_send_csrk_info ");
     smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_CSRK, FALSE);
 
@@ -614,6 +630,8 @@
 *******************************************************************************/
 void smp_proc_discard(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_proc_discard ");
     smp_reset_control_value(p_cb);
 }
@@ -623,6 +641,8 @@
 *******************************************************************************/
 void smp_proc_release_delay(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_proc_release_delay ");
     btu_stop_timer (&p_cb->rsp_timer_ent);
     btu_start_timer (&p_cb->rsp_timer_ent, BTU_TTYPE_SMP_PAIRING_CMD,
@@ -635,6 +655,8 @@
 *******************************************************************************/
 void smp_proc_release_delay_tout(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_proc_release_delay_tout ");
     btu_stop_timer (&p_cb->rsp_timer_ent);
     smp_proc_pairing_cmpl(p_cb);
@@ -750,6 +772,7 @@
     UINT8 int_evt = 0;
     tSMP_KEY key;
     tSMP_INT_DATA   *p = NULL;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG3 ("smp_decide_asso_model p_cb->peer_io_caps = %d p_cb->loc_io_caps = %d \
                        p_cb->peer_auth_req = %02x",
@@ -847,6 +870,8 @@
 *******************************************************************************/
 void smp_proc_io_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_proc_io_rsp ");
     if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD)
     {
@@ -887,9 +912,11 @@
 *******************************************************************************/
 void smp_pair_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_pair_terminate ");
 
-        p_cb->status = SMP_CONN_TOUT;
+    p_cb->status = SMP_CONN_TOUT;
 
     smp_proc_pairing_cmpl(p_cb);
 }
@@ -914,11 +941,12 @@
 }
 /*******************************************************************************
 ** Function         smp_idle_terminate
-** Description      This function calledin idle state to determine to send authentication
+** Description      This function called in idle state to determine to send authentication
 **                  complete or not.
 *******************************************************************************/
 void smp_idle_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
     if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD)
     {
         SMP_TRACE_DEBUG0("Pairing terminated at IDLE state.");
diff --git a/stack/smp/smp_api.c b/stack/smp/smp_api.c
index b802376..64644da 100644
--- a/stack/smp/smp_api.c
+++ b/stack/smp/smp_api.c
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #if SMP_INCLUDED == TRUE
     #include "smp_int.h"
     #include "smp_api.h"
@@ -284,6 +285,7 @@
     tSMP_CB *p_cb = & smp_cb;
     UINT8   failure = SMP_OOB_FAIL;
     tSMP_KEY        key;
+    UNUSED(bd_addr);
 
     SMP_TRACE_EVENT2 ("SMP_OobDataReply State: %d  res:%d",
                       smp_cb.state, res);
diff --git a/stack/smp/smp_keys.c b/stack/smp/smp_keys.c
index a1955f2..49612a5 100644
--- a/stack/smp/smp_keys.c
+++ b/stack/smp/smp_keys.c
@@ -24,6 +24,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
+#include "bt_utils.h"
 
 #if SMP_INCLUDED == TRUE
     #if SMP_DEBUG == TRUE
@@ -161,6 +162,8 @@
 *******************************************************************************/
 void smp_generate_passkey(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_generate_passkey");
     p_cb->rand_enc_proc = SMP_GEN_TK;
 
@@ -226,6 +229,7 @@
     UINT8           *p = ptext;
     tSMP_ENC        output;
     tSMP_STATUS     status = SMP_PAIR_FAIL_UNKNOWN;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG0 ("smp_generate_stk ");
 
@@ -266,6 +270,8 @@
 *******************************************************************************/
 void smp_generate_confirm (tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_generate_confirm");
     p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND;
     /* generate MRand or SRand */
@@ -284,6 +290,8 @@
 *******************************************************************************/
 void smp_genenrate_rand_cont(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_genenrate_rand_cont ");
     p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND_CONT;
     /* generate 64 MSB of MRand or SRand */
@@ -305,6 +313,7 @@
 void smp_generate_ltk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
     BOOLEAN     div_status;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG0 ("smp_generate_ltk ");
 
@@ -343,6 +352,7 @@
     UINT8       *p=buffer;
     tSMP_ENC    output;
     tSMP_STATUS   status = SMP_PAIR_FAIL_UNKNOWN;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG1 ("smp_compute_csrk div=%x", p_cb->div);
     BTM_GetDeviceEncRoot(er);
@@ -376,6 +386,7 @@
 void smp_generate_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
     BOOLEAN     div_status;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG0 ("smp_generate_csrk");
 
@@ -544,6 +555,7 @@
     BT_OCTET16      p1;
     tSMP_ENC       output;
     tSMP_STATUS     status = SMP_PAIR_FAIL_UNKNOWN;
+    UNUSED(bda);
 
     SMP_TRACE_DEBUG0 ("smp_calculate_comfirm ");
     /* generate p1 = pres || preq || rat' || iat' */
@@ -625,6 +637,8 @@
 *******************************************************************************/
 static void smp_genenrate_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_genenrate_confirm ");
     p_cb->rand_enc_proc = SMP_GEN_CONFIRM;
 
@@ -645,6 +659,8 @@
 *******************************************************************************/
 void smp_generate_compare (tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
 {
+    UNUSED(p_data);
+
     SMP_TRACE_DEBUG0 ("smp_generate_compare ");
     p_cb->rand_enc_proc = SMP_GEN_COMPARE;
 
@@ -755,6 +771,7 @@
     BT_OCTET16  er;
     tSMP_ENC    output;
     tSMP_STATUS     status = SMP_PAIR_FAIL_UNKNOWN;
+    UNUSED(p_data);
 
     SMP_TRACE_DEBUG0 ("smp_genenrate_ltk_cont ");
     BTM_GetDeviceEncRoot(er);
@@ -790,7 +807,7 @@
     BT_OCTET16  dhk;
     tSMP_ENC   output;
     tSMP_STATUS     status = SMP_PAIR_FAIL_UNKNOWN;
-
+    UNUSED(p);
 
     SMP_TRACE_DEBUG0 ("smp_generate_y ");
     BTM_GetDeviceDHK(dhk);
@@ -818,6 +835,8 @@
 *******************************************************************************/
 static void smp_generate_rand_vector (tSMP_CB *p_cb, tSMP_INT_DATA *p)
 {
+    UNUSED(p);
+
     /* generate EDIV and rand now */
     /* generate random vector */
     SMP_TRACE_DEBUG0 ("smp_generate_rand_vector ");
diff --git a/stack/smp/smp_utils.c b/stack/smp/smp_utils.c
index 168d6bd..dac0cc0 100644
--- a/stack/smp/smp_utils.c
+++ b/stack/smp/smp_utils.c
@@ -26,6 +26,7 @@
 #if SMP_INCLUDED == TRUE
 
 #include "bt_types.h"
+#include "bt_utils.h"
 #include <string.h>
 #include <ctype.h>
 #include "hcidefs.h"
@@ -151,6 +152,7 @@
 {
     tSMP_CB   *p_cb = &smp_cb;
     UINT8 failure = SMP_RSP_TIMEOUT;
+    UNUSED(p_tle);
 
     SMP_TRACE_EVENT1("smp_rsp_timeout state:%d", p_cb->state);
 
@@ -207,6 +209,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_confirm_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_CONFIRM_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -232,6 +236,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_rand_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_INIT_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -257,6 +263,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_encrypt_info_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ENC_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -282,6 +290,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_master_id_cmd ");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_MASTER_ID_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -309,6 +319,9 @@
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
     BT_OCTET16  irk;
+    UNUSED(cmd_code);
+    UNUSED(p_cb);
+
     SMP_TRACE_EVENT0("smp_build_identity_info_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -337,7 +350,8 @@
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
     BD_ADDR     static_addr;
-
+    UNUSED(cmd_code);
+    UNUSED(p_cb);
 
     SMP_TRACE_EVENT0("smp_build_id_addr_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_ADDR_SIZE + L2CAP_MIN_OFFSET)) != NULL)
@@ -367,6 +381,7 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
 
     SMP_TRACE_EVENT0("smp_build_signing_info_cmd");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_SIGN_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
@@ -393,6 +408,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_pairing_fail");
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_PAIR_FAIL_SIZE + L2CAP_MIN_OFFSET)) != NULL)
     {
@@ -418,6 +435,8 @@
 {
     BT_HDR      *p_buf = NULL ;
     UINT8       *p;
+    UNUSED(cmd_code);
+
     SMP_TRACE_EVENT0("smp_build_security_request");
 
     if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + 2 + L2CAP_MIN_OFFSET)) != NULL)
diff --git a/stack/srvc/srvc_battery.c b/stack/srvc/srvc_battery.c
index 22e538b..0606fd2 100644
--- a/stack/srvc/srvc_battery.c
+++ b/stack/srvc/srvc_battery.c
@@ -17,7 +17,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
-
+#include "bt_utils.h"
 #include "gatt_api.h"
 #include "gatt_int.h"
 #include "srvc_eng_int.h"
@@ -115,10 +115,11 @@
     tBA_INST    *p_inst = &battery_cb.battery_inst[0];
     tGATT_STATUS    st = GATT_NOT_FOUND;
     UINT8       act = SRVC_ACT_RSP;
+    UNUSED(p_value);
 
-        for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
-        {
-            /* read battery level */
+    for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
+    {
+        /* read battery level */
         if (handle == p_inst->ba_level_hdl ||
             handle == p_inst->clt_cfg_hdl ||
             handle == p_inst->rpt_ref_hdl ||
@@ -164,6 +165,7 @@
 *******************************************************************************/
 BOOLEAN battery_gatt_c_read_ba_req(UINT16 conn_id)
 {
+    UNUSED(conn_id);
     return TRUE;
 }
 
@@ -179,6 +181,10 @@
 void battery_c_cmpl_cback (tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op,
                               tGATT_STATUS status, tGATT_CL_COMPLETE *p_data)
 {
+    UNUSED(p_clcb);
+    UNUSED(op);
+    UNUSED(status);
+    UNUSED(p_data);
 }
 
 
@@ -395,6 +401,7 @@
 *******************************************************************************/
 BOOLEAN Battery_ReadBatteryLevel(BD_ADDR peer_bda)
 {
+    UNUSED(peer_bda);
     /* to be implemented */
     return TRUE;
 }
diff --git a/stack/srvc/srvc_dis.c b/stack/srvc/srvc_dis.c
index fcface2..90b4acd 100644
--- a/stack/srvc/srvc_dis.c
+++ b/stack/srvc/srvc_dis.c
@@ -17,7 +17,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
-
+#include "bt_utils.h"
 #include "gatt_api.h"
 #include "gatt_int.h"
 #include "srvc_eng_int.h"
@@ -76,6 +76,8 @@
 *******************************************************************************/
 UINT8 dis_write_attr_value(tGATT_WRITE_REQ * p_data, tGATT_STATUS *p_status)
 {
+    UNUSED(p_data);
+
     *p_status = GATT_WRITE_NOT_PERMIT;
     return SRVC_ACT_RSP;
 }
@@ -90,6 +92,7 @@
     UINT16          offset = p_value->offset;
     UINT8           act = SRVC_ACT_RSP;
     tGATT_STATUS    st = GATT_NOT_FOUND;
+    UNUSED(clcb_idx);
 
     for (i = 0; i < DIS_MAX_CHAR_NUM; i ++, p_db_attr ++)
     {
diff --git a/stack/srvc/srvc_eng.c b/stack/srvc/srvc_eng.c
index d8db1b0..4598738 100644
--- a/stack/srvc/srvc_eng.c
+++ b/stack/srvc/srvc_eng.c
@@ -17,7 +17,7 @@
  ******************************************************************************/
 
 #include "bt_target.h"
-
+#include "bt_utils.h"
 #include "gatt_api.h"
 #include "gatt_int.h"
 #include "srvc_eng_int.h"
@@ -230,6 +230,7 @@
 UINT8 srvc_eng_process_write_req (UINT8 clcb_idx, tGATT_WRITE_REQ *p_data, tGATTS_RSP *p_rsp, tGATT_STATUS *p_status)
 {
     UINT8       act = SRVC_ACT_RSP;
+    UNUSED(p_rsp);
 
     if (dis_valid_handle_range(p_data->handle))
     {
@@ -342,6 +343,8 @@
 static void srvc_eng_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
                                         BOOLEAN connected, tGATT_DISCONN_REASON reason)
 {
+    UNUSED(gatt_if);
+
     GATT_TRACE_EVENT5 ("srvc_eng_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
                        (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
                        (bda[4]<<8)+bda[5], connected, conn_id, reason);
diff --git a/udrv/ulinux/uipc.c b/udrv/ulinux/uipc.c
index 846fa17..795f615 100644
--- a/udrv/ulinux/uipc.c
+++ b/udrv/ulinux/uipc.c
@@ -50,6 +50,7 @@
 
 #include <cutils/sockets.h>
 #include "audio_a2dp_hw.h"
+#include "bt_utils.h"
 
 /*****************************************************************************
 **  Constants & Macros
@@ -518,6 +519,7 @@
 {
     int ch_id;
     int result;
+    UNUSED(arg);
 
     prctl(PR_SET_NAME, (unsigned long)"uipc-main", 0, 0, 0);
 
@@ -608,6 +610,8 @@
 
 UDRV_API void UIPC_Init(void *p_data)
 {
+    UNUSED(p_data);
+
     BTIF_TRACE_DEBUG0("UIPC_Init");
 
     memset(&uipc_main, 0, sizeof(tUIPC_MAIN));
@@ -702,6 +706,8 @@
  *******************************************************************************/
 UDRV_API BOOLEAN UIPC_SendBuf(tUIPC_CH_ID ch_id, BT_HDR *p_msg)
 {
+    UNUSED(p_msg);
+
     BTIF_TRACE_DEBUG1("UIPC_SendBuf : ch_id %d NOT IMPLEMENTED", ch_id);
 
     UIPC_LOCK();
@@ -726,6 +732,7 @@
         UINT16 msglen)
 {
     int n;
+    UNUSED(msg_evt);
 
     BTIF_TRACE_DEBUG2("UIPC_Send : ch_id:%d %d bytes", ch_id, msglen);
 
@@ -752,6 +759,8 @@
  *******************************************************************************/
 UDRV_API void UIPC_ReadBuf(tUIPC_CH_ID ch_id, BT_HDR *p_msg)
 {
+    UNUSED(p_msg);
+
     BTIF_TRACE_DEBUG1("UIPC_ReadBuf : ch_id:%d NOT IMPLEMENTED", ch_id);
 
     UIPC_LOCK();
@@ -774,6 +783,7 @@
     int n_read = 0;
     int fd = uipc_main.ch[ch_id].fd;
     struct pollfd pfd;
+    UNUSED(p_msg_evt);
 
     if (ch_id >= UIPC_CH_NUM)
     {