Cleanups needed to make clang happy

This patch removes a slew of unused variables and some unused functions,
fixes some incomplete initializations of structs and an sprintf
parameter mismatching the format string.

Change-Id: I35f22fdccc8350f885cd357d3685b869224fa433
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index c110ee8..550a25e 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -423,14 +423,12 @@
 *******************************************************************************/
 BOOLEAN check_sdp_bl(const bt_bdaddr_t *remote_bdaddr)
 {
-    UINT8 i = 0;
     UINT16 manufacturer = 0;
     UINT8 lmp_ver = 0;
     UINT16 lmp_subver = 0;
     tBTM_STATUS btm_status;
     bt_property_t prop_name;
     bt_remote_version_t info;
-    bt_status_t status;
 
 
     if (remote_bdaddr == NULL)
@@ -680,7 +678,6 @@
 *******************************************************************************/
 void btif_dm_cb_remove_bond(bt_bdaddr_t *bd_addr)
 {
-     bdstr_t bdstr;
      /*special handling for HID devices */
      /*  VUP needs to be sent if its a HID Device. The HID HOST module will check if there
      is a valid hid connection with this bd_addr. If yes VUP will be issued.*/
@@ -1182,11 +1179,9 @@
         {
             /* inquiry result */
             UINT32 cod;
-            UINT8 *p_eir_remote_name = NULL;
             bt_bdname_t bdname;
             bt_bdaddr_t bdaddr;
             UINT8 remote_name_len;
-            UINT8 *p_cached_name = NULL;
             tBTA_SERVICE_MASK services = 0;
             bdstr_t bdstr;
 
@@ -1334,9 +1329,8 @@
     {
         case BTA_DM_DISC_RES_EVT:
         {
-            bt_uuid_t uuid_arr[BT_MAX_NUM_UUIDS]; /* Max 32 services */
             bt_property_t prop;
-            uint32_t i = 0,  j = 0;
+            uint32_t i = 0;
             bt_bdaddr_t bd_addr;
             bt_status_t ret;
 
@@ -1470,7 +1464,6 @@
         {
             bt_service_record_t rec;
             bt_property_t prop;
-            uint32_t i = 0;
             bt_bdaddr_t bd_addr;
 
             memset(&rec, 0, sizeof(bt_service_record_t));
@@ -1513,7 +1506,6 @@
 *******************************************************************************/
 static void btif_dm_upstreams_evt(UINT16 event, char* p_param)
 {
-    tBTA_DM_SEC_EVT dm_event = (tBTA_DM_SEC_EVT)event;
     tBTA_DM_SEC *p_data = (tBTA_DM_SEC*)p_param;
     tBTA_SERVICE_MASK service_mask;
     uint32_t i;
@@ -2443,8 +2435,6 @@
 *******************************************************************************/
 bt_status_t btif_dm_get_adapter_property(bt_property_t *prop)
 {
-    bt_status_t status;
-
     BTIF_TRACE_EVENT("%s: type=0x%x", __FUNCTION__, prop->type);
     switch (prop->type)
     {
@@ -2818,8 +2808,6 @@
 
 void    btif_dm_load_ble_local_keys(void)
 {
-    bt_status_t bt_status;
-
     memset(&ble_local_key_cb, 0, sizeof(btif_dm_local_key_cb_t));
 
     if (btif_storage_get_ble_local_key(BTIF_DM_LE_LOCAL_KEY_ER,(char*)&ble_local_key_cb.er[0],