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

Commit 3e79bfce authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

Merge "system/stack: Remove UNUSED_ATTR" into main am: 2b692157

parents c8ede7d1 2b692157
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ static const tA2DP_DECODER_INTERFACE a2dp_decoder_interface_aac = {
    nullptr,  // decoder_configure
};

UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAac(
static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAac(
    const tA2DP_AAC_CIE* p_cap, const uint8_t* p_codec_info,
    bool is_capability);

@@ -248,7 +248,7 @@ bool A2DP_IsSourceCodecValidAac(const uint8_t* p_codec_info) {
         (A2DP_ParseInfoAac(&cfg_cie, p_codec_info, true) == A2DP_SUCCESS);
}

bool A2DP_IsSinkCodecValidAac(UNUSED_ATTR const uint8_t* p_codec_info) {
bool A2DP_IsSinkCodecValidAac(const uint8_t* p_codec_info) {
  tA2DP_AAC_CIE cfg_cie;

  /* Use a liberal check when parsing the codec info */
@@ -256,7 +256,7 @@ bool A2DP_IsSinkCodecValidAac(UNUSED_ATTR const uint8_t* p_codec_info) {
         (A2DP_ParseInfoAac(&cfg_cie, p_codec_info, true) == A2DP_SUCCESS);
}

bool A2DP_IsPeerSourceCodecValidAac(UNUSED_ATTR const uint8_t* p_codec_info) {
bool A2DP_IsPeerSourceCodecValidAac(const uint8_t* p_codec_info) {
  tA2DP_AAC_CIE cfg_cie;

  /* Use a liberal check when parsing the codec info */
@@ -326,12 +326,12 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAac(
  return A2DP_SUCCESS;
}

bool A2DP_UsesRtpHeaderAac(UNUSED_ATTR bool content_protection_enabled,
                           UNUSED_ATTR const uint8_t* p_codec_info) {
bool A2DP_UsesRtpHeaderAac(bool /* content_protection_enabled */,
                           const uint8_t* /* p_codec_info */) {
  return true;
}

const char* A2DP_CodecNameAac(UNUSED_ATTR const uint8_t* p_codec_info) {
const char* A2DP_CodecNameAac(const uint8_t* /* p_codec_info */) {
  return "AAC";
}

@@ -594,9 +594,9 @@ bool A2DP_GetPacketTimestampAac(const uint8_t* p_codec_info,
  return true;
}

bool A2DP_BuildCodecHeaderAac(UNUSED_ATTR const uint8_t* p_codec_info,
                              UNUSED_ATTR BT_HDR* p_buf,
                              UNUSED_ATTR uint16_t frames_per_packet) {
bool A2DP_BuildCodecHeaderAac(const uint8_t* /* p_codec_info */,
                              BT_HDR* /* p_buf */,
                              uint16_t /* frames_per_packet */) {
  return true;
}

@@ -703,12 +703,12 @@ bool A2DP_AdjustCodecAac(uint8_t* p_codec_info) {
}

btav_a2dp_codec_index_t A2DP_SourceCodecIndexAac(
    UNUSED_ATTR const uint8_t* p_codec_info) {
    const uint8_t* /* p_codec_info */) {
  return BTAV_A2DP_CODEC_INDEX_SOURCE_AAC;
}

btav_a2dp_codec_index_t A2DP_SinkCodecIndexAac(
    UNUSED_ATTR const uint8_t* p_codec_info) {
    const uint8_t* /* p_codec_info */) {
  return BTAV_A2DP_CODEC_INDEX_SINK_AAC;
}

+1 −2
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@
#include "avdt_api.h"
#include "internal_include/bt_target.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "sdpdefs.h"
#include "stack/include/bt_types.h"
#include "stack/include/bt_uuid16.h"
@@ -71,7 +70,7 @@ static uint16_t a2dp_attr_list[] = {
 * Returns          Nothing.
 *
 *****************************************************************************/
static void a2dp_sdp_cback(UNUSED_ATTR const RawAddress& bd_addr,
static void a2dp_sdp_cback(const RawAddress& /* bd_addr */,
                           tSDP_STATUS status) {
  tSDP_DISC_REC* p_rec = NULL;
  tSDP_DISC_ATTR* p_attr;
+6 −6
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ UNUSED_ATTR static void A2DP_ParseMplHeaderSbc(uint8_t* p_src, bool* p_frag,
  }
}

const char* A2DP_CodecNameSbc(UNUSED_ATTR const uint8_t* p_codec_info) {
const char* A2DP_CodecNameSbc(const uint8_t* /* p_codec_info */) {
  return "SBC";
}

@@ -684,14 +684,14 @@ int A2DP_GetSinkTrackChannelTypeSbc(const uint8_t* p_codec_info) {
  return -1;
}

bool A2DP_GetPacketTimestampSbc(UNUSED_ATTR const uint8_t* p_codec_info,
bool A2DP_GetPacketTimestampSbc(const uint8_t* /* p_codec_info */,
                                const uint8_t* p_data, uint32_t* p_timestamp) {
  *p_timestamp = *(const uint32_t*)p_data;
  return true;
}

bool A2DP_BuildCodecHeaderSbc(UNUSED_ATTR const uint8_t* p_codec_info,
                              BT_HDR* p_buf, uint16_t frames_per_packet) {
bool A2DP_BuildCodecHeaderSbc(const uint8_t* /* p_codec_info */, BT_HDR* p_buf,
                              uint16_t frames_per_packet) {
  // this doesn't happen in real life, but keeps fuzzer happy
  if (p_buf->len - p_buf->offset < A2DP_SBC_MPL_HDR_LEN) {
    return false;
@@ -808,12 +808,12 @@ bool A2DP_AdjustCodecSbc(uint8_t* p_codec_info) {
}

btav_a2dp_codec_index_t A2DP_SourceCodecIndexSbc(
    UNUSED_ATTR const uint8_t* p_codec_info) {
    const uint8_t* /* p_codec_info */) {
  return BTAV_A2DP_CODEC_INDEX_SOURCE_SBC;
}

btav_a2dp_codec_index_t A2DP_SinkCodecIndexSbc(
    UNUSED_ATTR const uint8_t* p_codec_info) {
    const uint8_t* /* p_codec_info */) {
  return BTAV_A2DP_CODEC_INDEX_SINK_SBC;
}

+10 −10
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static const tA2DP_ENCODER_INTERFACE a2dp_encoder_interface_aptx = {
    nullptr  // set_transmit_queue_length
};

UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptx(
static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptx(
    const tA2DP_APTX_CIE* p_cap, const uint8_t* p_codec_info,
    bool is_peer_codec_info);

@@ -200,7 +200,7 @@ bool A2DP_IsVendorPeerSinkCodecValidAptx(const uint8_t* p_codec_info) {
// is acting as an A2DP source.
// Returns A2DP_SUCCESS if the codec configuration matches with capabilities,
// otherwise the corresponding A2DP error status code.
static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptx(
UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptx(
    const tA2DP_APTX_CIE* p_cap, const uint8_t* p_codec_info,
    bool is_capability) {
  tA2DP_STATUS status;
@@ -229,13 +229,13 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptx(
  return A2DP_SUCCESS;
}

bool A2DP_VendorUsesRtpHeaderAptx(UNUSED_ATTR bool content_protection_enabled,
                                  UNUSED_ATTR const uint8_t* p_codec_info) {
bool A2DP_VendorUsesRtpHeaderAptx(bool /* content_protection_enabled */,
                                  const uint8_t* /* p_codec_info */) {
  // no RTP header for aptX classic and no Copy Protection byte
  return false;
}

const char* A2DP_VendorCodecNameAptx(UNUSED_ATTR const uint8_t* p_codec_info) {
const char* A2DP_VendorCodecNameAptx(const uint8_t* /* p_codec_info */) {
  return "aptX";
}

@@ -339,7 +339,7 @@ int A2DP_VendorGetTrackChannelCountAptx(const uint8_t* p_codec_info) {
  return -1;
}

bool A2DP_VendorGetPacketTimestampAptx(UNUSED_ATTR const uint8_t* p_codec_info,
bool A2DP_VendorGetPacketTimestampAptx(const uint8_t* /* p_codec_info */,
                                       const uint8_t* p_data,
                                       uint32_t* p_timestamp) {
  // TODO: Is this function really codec-specific?
@@ -347,9 +347,9 @@ bool A2DP_VendorGetPacketTimestampAptx(UNUSED_ATTR const uint8_t* p_codec_info,
  return true;
}

bool A2DP_VendorBuildCodecHeaderAptx(UNUSED_ATTR const uint8_t* p_codec_info,
                                     UNUSED_ATTR BT_HDR* p_buf,
                                     UNUSED_ATTR uint16_t frames_per_packet) {
bool A2DP_VendorBuildCodecHeaderAptx(const uint8_t* /* p_codec_info */,
                                     BT_HDR* /* p_buf */,
                                     uint16_t /* frames_per_packet */) {
  // Nothing to do
  return true;
}
@@ -408,7 +408,7 @@ bool A2DP_VendorAdjustCodecAptx(uint8_t* p_codec_info) {
}

btav_a2dp_codec_index_t A2DP_VendorSourceCodecIndexAptx(
    UNUSED_ATTR const uint8_t* p_codec_info) {
    const uint8_t* /* p_codec_info */) {
  return BTAV_A2DP_CODEC_INDEX_SOURCE_APTX;
}

+11 −12
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ static const tA2DP_ENCODER_INTERFACE a2dp_encoder_interface_aptx_hd = {
    nullptr  // set_transmit_queue_length
};

UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptxHd(
static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptxHd(
    const tA2DP_APTX_HD_CIE* p_cap, const uint8_t* p_codec_info,
    bool is_peer_codec_info);

@@ -219,7 +219,7 @@ bool A2DP_IsVendorPeerSinkCodecValidAptxHd(const uint8_t* p_codec_info) {
// is acting as an A2DP source.
// Returns A2DP_SUCCESS if the codec configuration matches with capabilities,
// otherwise the corresponding A2DP error status code.
static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptxHd(
UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptxHd(
    const tA2DP_APTX_HD_CIE* p_cap, const uint8_t* p_codec_info,
    bool is_capability) {
  tA2DP_STATUS status;
@@ -248,13 +248,12 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityAptxHd(
  return A2DP_SUCCESS;
}

bool A2DP_VendorUsesRtpHeaderAptxHd(UNUSED_ATTR bool content_protection_enabled,
                                    UNUSED_ATTR const uint8_t* p_codec_info) {
bool A2DP_VendorUsesRtpHeaderAptxHd(bool /* content_protection_enabled */,
                                    const uint8_t* /* p_codec_info */) {
  return true;
}

const char* A2DP_VendorCodecNameAptxHd(
    UNUSED_ATTR const uint8_t* p_codec_info) {
const char* A2DP_VendorCodecNameAptxHd(const uint8_t* /* p_codec_info */) {
  return "aptX-HD";
}

@@ -361,17 +360,17 @@ int A2DP_VendorGetTrackChannelCountAptxHd(const uint8_t* p_codec_info) {
  return -1;
}

bool A2DP_VendorGetPacketTimestampAptxHd(
    UNUSED_ATTR const uint8_t* p_codec_info, const uint8_t* p_data,
bool A2DP_VendorGetPacketTimestampAptxHd(const uint8_t* /* p_codec_info */,
                                         const uint8_t* p_data,
                                         uint32_t* p_timestamp) {
  // TODO: Is this function really codec-specific?
  *p_timestamp = *(const uint32_t*)p_data;
  return true;
}

bool A2DP_VendorBuildCodecHeaderAptxHd(UNUSED_ATTR const uint8_t* p_codec_info,
                                       UNUSED_ATTR BT_HDR* p_buf,
                                       UNUSED_ATTR uint16_t frames_per_packet) {
bool A2DP_VendorBuildCodecHeaderAptxHd(const uint8_t* /* p_codec_info */,
                                       BT_HDR* /* p_buf */,
                                       uint16_t /* frames_per_packet */) {
  // Nothing to do
  return true;
}
Loading