Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d59a1a7e authored by Mike J. Chen's avatar Mike J. Chen
Browse files

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: default avatarMike J. Chen <mjchen@google.com>
parent 328c1a94
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -247,6 +247,8 @@ UINT8 GKI_create_task (TASKPTR task_entry, UINT8 task_id, INT8 *taskname, UINT16
    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 @@ void* timer_thread(void *arg)
    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;
@@ -788,6 +791,7 @@ 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 @@ void GKI_os_free (void *p_mem)
*******************************************************************************/
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_suspend_task (UINT8 task_id)
*******************************************************************************/
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);
+90 −2
Original line number Diff line number Diff line
@@ -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 void ts_log(char *tag, int val, struct timespec *pprev_opt)
    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 audio_format_t out_get_format(const struct audio_stream *stream)

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_set_format(struct audio_stream *stream, audio_format_t format)
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_standby(struct audio_stream *stream)

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 int out_set_parameters(struct audio_stream *stream, const char *kvpairs)

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 uint32_t out_get_latency(const struct audio_stream_out *stream)
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_set_volume(struct audio_stream_out *stream, float left,
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 int out_remove_audio_effect(const struct audio_stream *stream, effect_han

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 int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
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 int in_set_gain(struct audio_stream_in *stream, float gain)
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 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
    struct a2dp_stream_out *out;
    int ret = 0;
    int i;
    UNUSED(handle);
    UNUSED(devices);
    UNUSED(flags);

    INFO("opening output");

@@ -908,6 +968,7 @@ static char * adev_get_parameters(const struct audio_hw_device *dev,
                                  const char *keys)
{
    struct str_parms *parms;
    UNUSED(dev);

    FNLOG();

@@ -931,6 +992,9 @@ static int adev_init_check(const struct audio_hw_device *dev)

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_voice_volume(struct audio_hw_device *dev, float volume)

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_master_volume(struct audio_hw_device *dev, float volume)

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_mode(struct audio_hw_device *dev, int mode)

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_set_mic_mute(struct audio_hw_device *dev, bool state)

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 int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
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 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
    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 @@ err_open:
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 void adev_close_input_stream(struct audio_hw_device *dev,

static int adev_dump(const audio_hw_device_t *device, int fd)
{
    UNUSED(device);
    UNUSED(fd);

    FNLOG();

    return 0;
+9 −0
Original line number Diff line number Diff line
@@ -334,6 +334,8 @@ void bta_ag_disc_acp_res(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
*******************************************************************************/
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_open_fail(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
*******************************************************************************/
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 @@ void bta_ag_rfc_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
    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 @@ void bta_ag_rfc_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
    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_post_sco_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
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_ci_rx_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
*******************************************************************************/
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)
+6 −0
Original line number Diff line number Diff line
@@ -631,6 +631,7 @@ static UINT8 bta_ag_parse_chld(tBTA_AG_SCB *p_scb, char *p_s)
{
    UINT8   retval = 0;
    INT16   idx = -1;
    UNUSED(p_scb);

    if (p_s[1] != 0)
    {
@@ -1747,6 +1748,9 @@ void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
    {
        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_bcs(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
*******************************************************************************/
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;

+3 −0
Original line number Diff line number Diff line
@@ -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 @@ void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
{
    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);
Loading