hal: fix compiler warnings which are now treated as errors

With CLANG enabled and -Wall & -Werror being set in
LOCAL_CFLAGS, all warnings are treated as errors.

This commit fixes all the warnings most of which are
about unused variables and functions.

Change-Id: I32c6593fa0ad6a4fdca5dc8e6c76982a146a8bc6
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 8f49b8d..846f88f 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -391,7 +391,6 @@
 void audio_extn_utils_dump_streams_output_cfg_list(
                                        struct listnode *streams_output_cfg_list)
 {
-    int i=0;
     struct listnode *node_i, *node_j;
     struct streams_output_cfg *so_info;
     struct stream_format *sf_info;
@@ -418,7 +417,6 @@
 {
     struct listnode *node_i, *node_j;
     struct streams_output_cfg *so_info;
-    struct stream_format *sf_info;
 
     ALOGV("%s", __func__);
     while (!list_empty(streams_output_cfg_list)) {
@@ -490,10 +488,9 @@
                                   audio_channel_mask_t channel_mask,
                                   struct stream_app_type_cfg *app_type_cfg)
 {
-    struct listnode *node_i, *node_j, *node_k;
+    struct listnode *node_i, *node_j;
     struct streams_output_cfg *so_info;
     struct stream_format *sf_info;
-    struct stream_sample_rate *ss_info;
     char value[PROPERTY_VALUE_MAX] = {0};
 
     if ((24 == bit_width) &&
@@ -567,7 +564,7 @@
     char mixer_ctl_name[MAX_LENGTH_MIXER_CONTROL_IN_INT];
     int app_type_cfg[MAX_LENGTH_MIXER_CONTROL_IN_INT], len = 0, rc;
     struct mixer_ctl *ctl;
-    int pcm_device_id, acdb_dev_id, snd_device = usecase->out_snd_device;
+    int pcm_device_id = 0, acdb_dev_id, snd_device = usecase->out_snd_device;
     int32_t sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
     char value[PROPERTY_VALUE_MAX] = {0};
 
@@ -855,7 +852,6 @@
         default:
             break;
     }
-done:
     outp[k] = '\0';
     return k;
 }
@@ -890,8 +886,6 @@
 void get_default_compressed_channel_status(
                                   unsigned char *channel_status)
 {
-     int32_t status = 0;
-     unsigned char bit_index;
      memset(channel_status,0,24);
 
      /* block start bit in preamble bit 3 */
@@ -937,7 +931,6 @@
                                                   unsigned char *channel_status)
 {
      int32_t status = 0;
-     unsigned char bit_index;
      memset(channel_status,0,24);
      /* block start bit in preamble bit 3 */
      channel_status[0] |= PROFESSIONAL;
@@ -989,7 +982,7 @@
     struct snd_aes_iec958 iec958;
     const char *mixer_ctl_name = "IEC958 Playback PCM Stream";
     struct mixer_ctl *ctl;
-    int i=0;
+    ALOGV("%s: buffer %s bytes %zd", __func__, buffer, bytes);
 #ifdef HDMI_PASSTHROUGH_ENABLED
     if (audio_extn_is_dolby_format(out->format) &&
         /*TODO:Extend code to support DTS passthrough*/