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

Commit c6b849ff authored by Mike J. Chen's avatar Mike J. Chen Committed by Android (Google) Code Review
Browse files

Merge changes Ifc373f95,I95eb887a,I1e6be2ab,Ia6ea939a,I147d0138, ... into klp-modular-dev

* changes:
  Make all warnings fatal compilation errors
  Major warnings cleanup
  Add macro UNUSED() to bt_utils.h
  Fix unused parameter warning in static function
  Add "static" to a static function
  Fix a number of unused parameter warnings in static functions
  Fix bug with wrong parameter passed to logu
  Default send_ind_evt should be FALSE
  Fix warning "implicit declaration of function 'GAP_BleReadPeerPrefConnParams'"
  Fix unused parameter warnings in static functions by changing prototype
  Fix some unused parameter warnings in static functions
  Fix warnings about implicit declaration of bdcmp and bdcpy
  Fix warning "comparison is always true due to limited range of data type"
  Fix warning "suggest braces around empty body in an 'if' statement"
  Fix warning "comparison is always true due to limited range of data type"
  Add a function prototype for btm_ble_test_command_complete
  Change argument to return ptr rather than assign to unused local
  Fix warning "comparison is always true due to limited range of data type"
  Fix warnings about implicit declarations
  Fix warning "implicit declaration of function 'bdcmp'"
  Fix warning "case label value exceeds maximum value for type"
  Fix missing initializer warning
  Fix missing initializer warning
  Fix warning about missing initializer
parents 68ec126d 7da6440a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ LOCAL_C_INCLUDES:= $(LOCAL_PATH)/common \
                   $(LOCAL_PATH)/../utils/include \
                   $(LOCAL_PATH)/../utils/include \
                   $(bdroid_C_INCLUDES) \
                   $(bdroid_C_INCLUDES) \


LOCAL_CFLAGS += -Werror -Wno-error=unused-parameter $(bdroid_CFLAGS)
LOCAL_CFLAGS += -Werror $(bdroid_CFLAGS)


ifeq ($(BOARD_HAVE_BLUETOOTH_BCM),true)
ifeq ($(BOARD_HAVE_BLUETOOTH_BCM),true)
LOCAL_CFLAGS += \
LOCAL_CFLAGS += \
+7 −3
Original line number Original line 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;
    struct sched_param param;
    int policy, ret = 0;
    int policy, ret = 0;
    pthread_attr_t attr1;
    pthread_attr_t attr1;
    UNUSED(stack);
    UNUSED(stacksize);


    GKI_TRACE( "GKI_create_task %x %d %s %x %d", (int)task_entry, (int)task_id,
    GKI_TRACE( "GKI_create_task %x %d %s %x %d", (int)task_entry, (int)task_id,
            (char*) taskname, (int) stack, (int)stacksize);
            (char*) taskname, (int) stack, (int)stacksize);
@@ -617,6 +619,7 @@ void* timer_thread(void *arg)
    int restart;
    int restart;
    tGKI_OS         *p_os = &gki_cb.os;
    tGKI_OS         *p_os = &gki_cb.os;
    int  *p_run_cond = &p_os->no_timer_suspend;
    int  *p_run_cond = &p_os->no_timer_suspend;
    (void)arg;


    /* Indicate that tick is just starting */
    /* Indicate that tick is just starting */
    restart = 1;
    restart = 1;
@@ -788,6 +791,7 @@ void GKI_run (void *p_task_id)
    struct timespec delay;
    struct timespec delay;
    int err;
    int err;
    volatile int * p_run_cond = &gki_cb.os.no_timer_suspend;
    volatile int * p_run_cond = &gki_cb.os.no_timer_suspend;
    UNUSED(p_task_id);


#ifndef GKI_NO_TICK_STOP
#ifndef GKI_NO_TICK_STOP
    /* adjust btld scheduling scheme now */
    /* adjust btld scheduling scheme now */
@@ -1404,9 +1408,9 @@ void GKI_os_free (void *p_mem)
*******************************************************************************/
*******************************************************************************/
UINT8 GKI_suspend_task (UINT8 task_id)
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 - NOT implemented", task_id);



    GKI_TRACE("GKI_suspend_task %d done", task_id);
    GKI_TRACE("GKI_suspend_task %d done", task_id);


    return (GKI_SUCCESS);
    return (GKI_SUCCESS);
@@ -1430,9 +1434,9 @@ UINT8 GKI_suspend_task (UINT8 task_id)
*******************************************************************************/
*******************************************************************************/
UINT8 GKI_resume_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 - NOT implemented", task_id);



    GKI_TRACE("GKI_resume_task %d done", task_id);
    GKI_TRACE("GKI_resume_task %d done", task_id);


    return (GKI_SUCCESS);
    return (GKI_SUCCESS);
+3 −1
Original line number Original line Diff line number Diff line
@@ -2,10 +2,12 @@ LOCAL_PATH:= $(call my-dir)


include $(CLEAR_VARS)
include $(CLEAR_VARS)


LOCAL_C_FLAGS := -Werror

LOCAL_SRC_FILES:= \
LOCAL_SRC_FILES:= \
	audio_a2dp_hw.c
	audio_a2dp_hw.c


LOCAL_C_INCLUDES+= .
LOCAL_C_INCLUDES+= . $(LOCAL_PATH)/../utils/include


LOCAL_SHARED_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
	libcutils liblog
	libcutils liblog
+90 −2
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@


#include <hardware/hardware.h>
#include <hardware/hardware.h>
#include "audio_a2dp_hw.h"
#include "audio_a2dp_hw.h"
#include "bt_utils.h"


#define LOG_TAG "audio_a2dp_hw"
#define LOG_TAG "audio_a2dp_hw"
/* #define LOG_NDEBUG 0 */
/* #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};
    static struct timespec prev = {0,0};
    unsigned long long now_us;
    unsigned long long now_us;
    unsigned long long diff_us;
    unsigned long long diff_us;
    UNUSED(tag);
    UNUSED(val);


    clock_gettime(CLOCK_MONOTONIC, &now);
    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)
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;
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
    DEBUG("setting format not yet supported (0x%x)", format);
    DEBUG("setting format not yet supported (0x%x)", format);
    return -ENOSYS;
    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)
static int out_standby(struct audio_stream *stream)
{
{
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
    int retval = 0;

    int retVal = 0;
    int retVal = 0;


    FNLOG();
    FNLOG();
@@ -570,6 +572,7 @@ static int out_standby(struct audio_stream *stream)


static int out_dump(const struct audio_stream *stream, int fd)
static int out_dump(const struct audio_stream *stream, int fd)
{
{
    UNUSED(fd);
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
    FNLOG();
    FNLOG();
    return 0;
    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)
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;
    struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;


    FNLOG();
    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,
static int out_set_volume(struct audio_stream_out *stream, float left,
                          float right)
                          float right)
{
{
    UNUSED(stream);
    UNUSED(left);
    UNUSED(right);

    FNLOG();
    FNLOG();


    /* volume controlled in audioflinger mixer (digital) */
    /* 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,
static int out_get_render_position(const struct audio_stream_out *stream,
                                   uint32_t *dsp_frames)
                                   uint32_t *dsp_frames)
{
{
    UNUSED(stream);
    UNUSED(dsp_frames);

    FNLOG();
    FNLOG();
    return -EINVAL;
    return -EINVAL;
}
}


static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
{
    UNUSED(stream);
    UNUSED(effect);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
static int out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
{
    UNUSED(stream);
    UNUSED(effect);

    FNLOG();
    FNLOG();
    return 0;
    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)
static uint32_t in_get_sample_rate(const struct audio_stream *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return 8000;
    return 8000;
}
}


static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate)
static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate)
{
{
    UNUSED(stream);
    UNUSED(rate);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static size_t in_get_buffer_size(const struct audio_stream *stream)
static size_t in_get_buffer_size(const struct audio_stream *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return 320;
    return 320;
}
}


static uint32_t in_get_channels(const struct audio_stream *stream)
static uint32_t in_get_channels(const struct audio_stream *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return AUDIO_CHANNEL_IN_MONO;
    return AUDIO_CHANNEL_IN_MONO;
}
}


static audio_format_t in_get_format(const struct audio_stream *stream)
static audio_format_t in_get_format(const struct audio_stream *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return AUDIO_FORMAT_PCM_16_BIT;
    return AUDIO_FORMAT_PCM_16_BIT;
}
}


static int in_set_format(struct audio_stream *stream, audio_format_t format)
static int in_set_format(struct audio_stream *stream, audio_format_t format)
{
{
    UNUSED(stream);
    UNUSED(format);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int in_standby(struct audio_stream *stream)
static int in_standby(struct audio_stream *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int in_dump(const struct audio_stream *stream, int fd)
static int in_dump(const struct audio_stream *stream, int fd)
{
{
    UNUSED(stream);
    UNUSED(fd);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
{
{
    UNUSED(stream);
    UNUSED(kvpairs);

    FNLOG();
    FNLOG();
    return 0;
    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,
static char * in_get_parameters(const struct audio_stream *stream,
                                const char *keys)
                                const char *keys)
{
{
    UNUSED(stream);
    UNUSED(keys);

    FNLOG();
    FNLOG();
    return strdup("");
    return strdup("");
}
}


static int in_set_gain(struct audio_stream_in *stream, float gain)
static int in_set_gain(struct audio_stream_in *stream, float gain)
{
{
    UNUSED(stream);
    UNUSED(gain);

    FNLOG();
    FNLOG();
    return 0;
    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,
static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
                       size_t bytes)
                       size_t bytes)
{
{
    UNUSED(stream);
    UNUSED(buffer);
    UNUSED(bytes);

    FNLOG();
    FNLOG();
    return bytes;
    return bytes;
}
}


static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
{
{
    UNUSED(stream);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
static int in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
{
    UNUSED(stream);
    UNUSED(effect);

    FNLOG();
    FNLOG();
    return 0;
    return 0;
}
}


static int in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
static int in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
{
    UNUSED(stream);
    UNUSED(effect);

    FNLOG();
    FNLOG();


    return 0;
    return 0;
@@ -796,6 +853,9 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
    struct a2dp_stream_out *out;
    struct a2dp_stream_out *out;
    int ret = 0;
    int ret = 0;
    int i;
    int i;
    UNUSED(handle);
    UNUSED(devices);
    UNUSED(flags);


    INFO("opening output");
    INFO("opening output");


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


    FNLOG();
    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)
static int adev_set_voice_volume(struct audio_hw_device *dev, float volume)
{
{
    UNUSED(dev);
    UNUSED(volume);

    FNLOG();
    FNLOG();


    return -ENOSYS;
    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)
static int adev_set_master_volume(struct audio_hw_device *dev, float volume)
{
{
    UNUSED(dev);
    UNUSED(volume);

    FNLOG();
    FNLOG();


    return -ENOSYS;
    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)
static int adev_set_mode(struct audio_hw_device *dev, int mode)
{
{
    UNUSED(dev);
    UNUSED(mode);

    FNLOG();
    FNLOG();


    return 0;
    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)
static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
{
    UNUSED(dev);
    UNUSED(state);

    FNLOG();
    FNLOG();


    return -ENOSYS;
    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)
static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
{
{
    UNUSED(dev);
    UNUSED(state);

    FNLOG();
    FNLOG();


    return -ENOSYS;
    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,
static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
                                         const struct audio_config *config)
                                         const struct audio_config *config)
{
{
    UNUSED(dev);
    UNUSED(config);

    FNLOG();
    FNLOG();


    return 320;
    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_audio_device *ladev = (struct a2dp_audio_device *)dev;
    struct a2dp_stream_in *in;
    struct a2dp_stream_in *in;
    int ret;
    int ret;
    UNUSED(handle);
    UNUSED(devices);
    UNUSED(config);


    FNLOG();
    FNLOG();


@@ -1017,6 +1099,9 @@ err_open:
static void adev_close_input_stream(struct audio_hw_device *dev,
static void adev_close_input_stream(struct audio_hw_device *dev,
                                   struct audio_stream_in *in)
                                   struct audio_stream_in *in)
{
{
    UNUSED(dev);
    UNUSED(in);

    FNLOG();
    FNLOG();


    return;
    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)
static int adev_dump(const audio_hw_device_t *device, int fd)
{
{
    UNUSED(device);
    UNUSED(fd);

    FNLOG();
    FNLOG();


    return 0;
    return 0;
+2 −1
Original line number Original line Diff line number Diff line
@@ -8,7 +8,7 @@ ifeq ($(BOARD_HAVE_BLUETOOTH_BCM),true)
LOCAL_CFLAGS += \
LOCAL_CFLAGS += \
	-DBOARD_HAVE_BLUETOOTH_BCM
	-DBOARD_HAVE_BLUETOOTH_BCM
endif
endif
LOCAL_CFLAGS += -DBUILDCFG $(bdroid_CFLAGS)
LOCAL_CFLAGS += -Werror -DBUILDCFG $(bdroid_CFLAGS)


LOCAL_PRELINK_MODULE:=false
LOCAL_PRELINK_MODULE:=false
LOCAL_SRC_FILES:= \
LOCAL_SRC_FILES:= \
@@ -98,6 +98,7 @@ LOCAL_C_INCLUDES+= . \
                   $(LOCAL_PATH)/../hcis/patchram \
                   $(LOCAL_PATH)/../hcis/patchram \
                   $(LOCAL_PATH)/../udrv/include \
                   $(LOCAL_PATH)/../udrv/include \
                   $(LOCAL_PATH)/../brcm/include \
                   $(LOCAL_PATH)/../brcm/include \
                   $(LOCAL_PATH)/../utils/include \
                   $(bdroid_C_INCLUDES) \
                   $(bdroid_C_INCLUDES) \




Loading