summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Myles Watson <mylesgw@google.com> 2024-04-19 15:58:58 -0700
committer Myles Watson <mylesgw@google.com> 2024-04-24 16:31:23 -0700
commitd33ada1d3fd39317ae2ab8a92d85254ecb8076ea (patch)
tree529c37a09e28de8b45a238ccecb4223438db5661
parentb5d4905cdc9cb43980164931b05d710bbb613a14 (diff)
system/stack: Remove UNUSED_ATTR
Comment out unused parameters to have the compiler check that they're unused. Bug: 336310650 Test: mma -j32 Flag: EXEMPT, mechanical refactor Change-Id: I55368273d61a24815dc16a5584994cb1dce15534
-rw-r--r--system/stack/a2dp/a2dp_aac.cc22
-rw-r--r--system/stack/a2dp/a2dp_api.cc3
-rw-r--r--system/stack/a2dp/a2dp_sbc.cc12
-rw-r--r--system/stack/a2dp/a2dp_vendor_aptx.cc20
-rw-r--r--system/stack/a2dp/a2dp_vendor_aptx_hd.cc23
-rw-r--r--system/stack/a2dp/a2dp_vendor_ldac.cc16
-rw-r--r--system/stack/a2dp/a2dp_vendor_opus.cc22
-rw-r--r--system/stack/acl/btm_acl.cc10
-rw-r--r--system/stack/acl/btm_pm.cc5
-rw-r--r--system/stack/avct/avct_bcb_act.cc19
-rw-r--r--system/stack/avct/avct_l2c.cc2
-rw-r--r--system/stack/avct/avct_l2c_br.cc2
-rw-r--r--system/stack/avct/avct_lcb.cc2
-rw-r--r--system/stack/avct/avct_lcb_act.cc16
-rw-r--r--system/stack/avdt/avdt_ccb.cc2
-rw-r--r--system/stack/avdt/avdt_ccb_act.cc26
-rw-r--r--system/stack/avdt/avdt_l2c.cc5
-rw-r--r--system/stack/avdt/avdt_msg.cc8
-rw-r--r--system/stack/avdt/avdt_scb.cc2
-rw-r--r--system/stack/avdt/avdt_scb_act.cc55
-rw-r--r--system/stack/avrc/avrc_bld_tg.cc12
-rw-r--r--system/stack/avrc/avrc_pars_ct.cc3
-rw-r--r--system/stack/avrc/avrc_sdp.cc3
-rw-r--r--system/stack/bnep/bnep_main.cc2
-rw-r--r--system/stack/btm/btm_ble_gap.cc9
-rw-r--r--system/stack/btm/btm_devctl.cc4
-rw-r--r--system/stack/btm/btm_inq.cc4
-rw-r--r--system/stack/btu/btu_hcif.cc5
-rw-r--r--system/stack/gatt/gatt_attr.cc13
-rw-r--r--system/stack/gatt/gatt_auth.cc3
-rw-r--r--system/stack/gatt/gatt_cl.cc19
-rw-r--r--system/stack/gatt/gatt_db.cc2
-rw-r--r--system/stack/gatt/gatt_main.cc4
-rw-r--r--system/stack/gatt/gatt_sr.cc8
-rw-r--r--system/stack/hid/hidh_api.cc3
-rw-r--r--system/stack/include/btu_hcif.h7
-rw-r--r--system/stack/l2cap/l2c_link.cc6
-rw-r--r--system/stack/pan/pan_main.cc4
-rw-r--r--system/stack/rfcomm/rfc_port_fsm.cc6
-rw-r--r--system/stack/smp/smp_keys.cc12
-rw-r--r--system/stack/smp/smp_l2c.cc5
-rw-r--r--system/stack/smp/smp_utils.cc81
-rw-r--r--system/stack/srvc/srvc_dis.cc4
-rw-r--r--system/stack/srvc/srvc_eng.cc8
-rw-r--r--system/stack/test/stack_avdtp_test.cc4
45 files changed, 222 insertions, 281 deletions
diff --git a/system/stack/a2dp/a2dp_aac.cc b/system/stack/a2dp/a2dp_aac.cc
index 03047a6083..4140aba576 100644
--- a/system/stack/a2dp/a2dp_aac.cc
+++ b/system/stack/a2dp/a2dp_aac.cc
@@ -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;
}
diff --git a/system/stack/a2dp/a2dp_api.cc b/system/stack/a2dp/a2dp_api.cc
index 90ea21301e..6415a7fa4b 100644
--- a/system/stack/a2dp/a2dp_api.cc
+++ b/system/stack/a2dp/a2dp_api.cc
@@ -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;
diff --git a/system/stack/a2dp/a2dp_sbc.cc b/system/stack/a2dp/a2dp_sbc.cc
index 1bff4e2fab..54f6c6e153 100644
--- a/system/stack/a2dp/a2dp_sbc.cc
+++ b/system/stack/a2dp/a2dp_sbc.cc
@@ -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;
}
diff --git a/system/stack/a2dp/a2dp_vendor_aptx.cc b/system/stack/a2dp/a2dp_vendor_aptx.cc
index f9a6bb7598..2948156402 100644
--- a/system/stack/a2dp/a2dp_vendor_aptx.cc
+++ b/system/stack/a2dp/a2dp_vendor_aptx.cc
@@ -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;
}
diff --git a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
index 677c37a076..dbd41df33d 100644
--- a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
+++ b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
@@ -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,
- uint32_t* p_timestamp) {
+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;
}
diff --git a/system/stack/a2dp/a2dp_vendor_ldac.cc b/system/stack/a2dp/a2dp_vendor_ldac.cc
index 2b3b700f0a..f264459be8 100644
--- a/system/stack/a2dp/a2dp_vendor_ldac.cc
+++ b/system/stack/a2dp/a2dp_vendor_ldac.cc
@@ -100,7 +100,7 @@ static const tA2DP_DECODER_INTERFACE a2dp_decoder_interface_ldac = {
a2dp_vendor_ldac_decoder_suspend, a2dp_vendor_ldac_decoder_configure,
};
-UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityLdac(
+static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityLdac(
const tA2DP_LDAC_CIE* p_cap, const uint8_t* p_codec_info,
bool is_peer_codec_info);
@@ -301,13 +301,13 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityLdac(
return A2DP_SUCCESS;
}
-bool A2DP_VendorUsesRtpHeaderLdac(UNUSED_ATTR bool content_protection_enabled,
- UNUSED_ATTR const uint8_t* p_codec_info) {
+bool A2DP_VendorUsesRtpHeaderLdac(bool /* content_protection_enabled */,
+ const uint8_t* /* p_codec_info */) {
// TODO: Is this correct? The RTP header is always included?
return true;
}
-const char* A2DP_VendorCodecNameLdac(UNUSED_ATTR const uint8_t* p_codec_info) {
+const char* A2DP_VendorCodecNameLdac(const uint8_t* /* p_codec_info */) {
return "LDAC";
}
@@ -506,7 +506,7 @@ int A2DP_VendorGetChannelModeCodeLdac(const uint8_t* p_codec_info) {
return -1;
}
-bool A2DP_VendorGetPacketTimestampLdac(UNUSED_ATTR const uint8_t* p_codec_info,
+bool A2DP_VendorGetPacketTimestampLdac(const uint8_t* /* p_codec_info */,
const uint8_t* p_data,
uint32_t* p_timestamp) {
// TODO: Is this function really codec-specific?
@@ -514,7 +514,7 @@ bool A2DP_VendorGetPacketTimestampLdac(UNUSED_ATTR const uint8_t* p_codec_info,
return true;
}
-bool A2DP_VendorBuildCodecHeaderLdac(UNUSED_ATTR const uint8_t* p_codec_info,
+bool A2DP_VendorBuildCodecHeaderLdac(const uint8_t* /* p_codec_info */,
BT_HDR* p_buf,
uint16_t frames_per_packet) {
uint8_t* p;
@@ -605,12 +605,12 @@ bool A2DP_VendorAdjustCodecLdac(uint8_t* p_codec_info) {
}
btav_a2dp_codec_index_t A2DP_VendorSourceCodecIndexLdac(
- UNUSED_ATTR const uint8_t* p_codec_info) {
+ const uint8_t* /* p_codec_info */) {
return BTAV_A2DP_CODEC_INDEX_SOURCE_LDAC;
}
btav_a2dp_codec_index_t A2DP_VendorSinkCodecIndexLdac(
- UNUSED_ATTR const uint8_t* p_codec_info) {
+ const uint8_t* /* p_codec_info */) {
return BTAV_A2DP_CODEC_INDEX_SINK_LDAC;
}
diff --git a/system/stack/a2dp/a2dp_vendor_opus.cc b/system/stack/a2dp/a2dp_vendor_opus.cc
index 4937547e67..e70f88a4db 100644
--- a/system/stack/a2dp/a2dp_vendor_opus.cc
+++ b/system/stack/a2dp/a2dp_vendor_opus.cc
@@ -117,7 +117,7 @@ static const tA2DP_DECODER_INTERFACE a2dp_decoder_interface_opus = {
a2dp_vendor_opus_decoder_suspend, a2dp_vendor_opus_decoder_configure,
};
-UNUSED_ATTR static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityOpus(
+static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityOpus(
const tA2DP_OPUS_CIE* p_cap, const uint8_t* p_codec_info,
bool is_peer_codec_info);
@@ -354,12 +354,12 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilityOpus(
return A2DP_SUCCESS;
}
-bool A2DP_VendorUsesRtpHeaderOpus(UNUSED_ATTR bool content_protection_enabled,
- UNUSED_ATTR const uint8_t* p_codec_info) {
+bool A2DP_VendorUsesRtpHeaderOpus(bool /* content_protection_enabled */,
+ const uint8_t* /* p_codec_info */) {
return true;
}
-const char* A2DP_VendorCodecNameOpus(UNUSED_ATTR const uint8_t* p_codec_info) {
+const char* A2DP_VendorCodecNameOpus(const uint8_t* /* p_codec_info */) {
return "Opus";
}
@@ -553,14 +553,14 @@ int A2DP_VendorGetFrameSizeOpus(const uint8_t* p_codec_info) {
return -1;
}
-bool A2DP_VendorGetPacketTimestampOpus(UNUSED_ATTR const uint8_t* p_codec_info,
+bool A2DP_VendorGetPacketTimestampOpus(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_VendorBuildCodecHeaderOpus(UNUSED_ATTR const uint8_t* p_codec_info,
+bool A2DP_VendorBuildCodecHeaderOpus(const uint8_t* /* p_codec_info */,
BT_HDR* p_buf,
uint16_t frames_per_packet) {
uint8_t* p;
@@ -646,12 +646,12 @@ bool A2DP_VendorAdjustCodecOpus(uint8_t* p_codec_info) {
}
btav_a2dp_codec_index_t A2DP_VendorSourceCodecIndexOpus(
- UNUSED_ATTR const uint8_t* p_codec_info) {
+ const uint8_t* /* p_codec_info */) {
return BTAV_A2DP_CODEC_INDEX_SOURCE_OPUS;
}
btav_a2dp_codec_index_t A2DP_VendorSinkCodecIndexOpus(
- UNUSED_ATTR const uint8_t* p_codec_info) {
+ const uint8_t* /* p_codec_info */) {
return BTAV_A2DP_CODEC_INDEX_SINK_OPUS;
}
@@ -1319,8 +1319,8 @@ bool A2dpCodecConfigOpusSink::init() {
bool A2dpCodecConfigOpusSink::useRtpHeaderMarkerBit() const { return false; }
bool A2dpCodecConfigOpusSink::updateEncoderUserConfig(
- UNUSED_ATTR const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
- UNUSED_ATTR bool* p_restart_input, UNUSED_ATTR bool* p_restart_output,
- UNUSED_ATTR bool* p_config_updated) {
+ const tA2DP_ENCODER_INIT_PEER_PARAMS* /* p_peer_params */,
+ bool* /* p_restart_input */, bool* /* p_restart_output */,
+ bool* /* p_config_updated */) {
return false;
}
diff --git a/system/stack/acl/btm_acl.cc b/system/stack/acl/btm_acl.cc
index bc6743610c..c4c91566b5 100644
--- a/system/stack/acl/btm_acl.cc
+++ b/system/stack/acl/btm_acl.cc
@@ -53,7 +53,6 @@
#include "os/log.h"
#include "os/parameter_provider.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "osi/include/properties.h"
#include "osi/include/stack_power_telemetry.h"
#include "rust/src/connection/ffi/connection_shim.h"
@@ -190,8 +189,7 @@ void NotifyAclRoleSwitchComplete(const RawAddress& bda, tHCI_ROLE new_role,
BTA_dm_report_role_change(bda, new_role, hci_status);
}
-void NotifyAclFeaturesReadComplete(tACL_CONN& p_acl,
- UNUSED_ATTR uint8_t max_page_number) {
+void NotifyAclFeaturesReadComplete(tACL_CONN& p_acl, uint8_t max_page_number) {
btm_process_remote_ext_features(&p_acl, max_page_number);
btm_set_link_policy(&p_acl, btm_cb.acl_cb_.DefaultLinkPolicy());
BTA_dm_notify_remote_features_complete(p_acl.remote_addr);
@@ -1760,7 +1758,7 @@ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda,
* Returns void
*
******************************************************************************/
-void btm_read_tx_power_timeout(UNUSED_ATTR void* data) {
+void btm_read_tx_power_timeout(void* /* data */) {
tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_tx_power_cmpl_cb;
btm_cb.devcb.p_tx_power_cmpl_cb = NULL;
if (p_cb) (*p_cb)((void*)NULL);
@@ -1841,7 +1839,7 @@ void btm_read_tx_power_complete(uint8_t* p, uint16_t evt_len, bool is_ble) {
* Returns void
*
******************************************************************************/
-void btm_read_rssi_timeout(UNUSED_ATTR void* data) {
+void btm_read_rssi_timeout(void* /* data */) {
tBTM_RSSI_RESULT result;
tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_rssi_cmpl_cb;
btm_cb.devcb.p_rssi_cmpl_cb = NULL;
@@ -1910,7 +1908,7 @@ void btm_read_rssi_complete(uint8_t* p, uint16_t evt_len) {
* Returns void
*
******************************************************************************/
-void btm_read_failed_contact_counter_timeout(UNUSED_ATTR void* data) {
+void btm_read_failed_contact_counter_timeout(void* /* data */) {
tBTM_FAILED_CONTACT_COUNTER_RESULT result;
tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_failed_contact_counter_cmpl_cb;
btm_cb.devcb.p_failed_contact_counter_cmpl_cb = NULL;
diff --git a/system/stack/acl/btm_pm.cc b/system/stack/acl/btm_pm.cc
index 6aece509f5..4665db986a 100644
--- a/system/stack/acl/btm_pm.cc
+++ b/system/stack/acl/btm_pm.cc
@@ -43,7 +43,6 @@
#include "main/shim/dumpsys.h"
#include "main/shim/entry.h"
#include "os/log.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "osi/include/stack_power_telemetry.h"
#include "stack/btm/btm_int_types.h"
#include "stack/include/bt_types.h"
@@ -767,7 +766,7 @@ void btm_pm_proc_mode_change(tHCI_STATUS hci_status, uint16_t hci_handle,
*
******************************************************************************/
void process_ssr_event(tHCI_STATUS status, uint16_t handle,
- UNUSED_ATTR uint16_t max_tx_lat, uint16_t max_rx_lat) {
+ uint16_t /* max_tx_lat */, uint16_t max_rx_lat) {
if (pm_mode_db.count(handle) == 0) {
log::warn("Received sniff subrating event with no active ACL");
return;
@@ -803,7 +802,7 @@ void btm_pm_on_sniff_subrating(tHCI_STATUS status, uint16_t handle,
maximum_receive_latency);
}
-void btm_pm_proc_ssr_evt(uint8_t* p, UNUSED_ATTR uint16_t evt_len) {
+void btm_pm_proc_ssr_evt(uint8_t* p, uint16_t /* evt_len */) {
uint8_t status;
uint16_t handle;
uint16_t max_tx_lat;
diff --git a/system/stack/avct/avct_bcb_act.cc b/system/stack/avct/avct_bcb_act.cc
index d13fc6248b..b8a85ec687 100644
--- a/system/stack/avct/avct_bcb_act.cc
+++ b/system/stack/avct/avct_bcb_act.cc
@@ -74,7 +74,7 @@ const tAVCT_BCB_ACTION avct_bcb_action[] = {
* available.
*
******************************************************************************/
-static BT_HDR* avct_bcb_msg_asmbl(UNUSED_ATTR tAVCT_BCB* p_bcb, BT_HDR* p_buf) {
+static BT_HDR* avct_bcb_msg_asmbl(tAVCT_BCB* /* p_bcb */, BT_HDR* p_buf) {
uint8_t* p;
uint8_t pkt_type;
@@ -105,7 +105,7 @@ static BT_HDR* avct_bcb_msg_asmbl(UNUSED_ATTR tAVCT_BCB* p_bcb, BT_HDR* p_buf) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) {
uint16_t result = AVCT_RESULT_FAIL;
tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb);
tL2CAP_ERTM_INFO ertm_info;
@@ -135,7 +135,7 @@ void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_unbind_disc(UNUSED_ATTR tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
+void avct_bcb_unbind_disc(tAVCT_BCB* /* p_bcb */, tAVCT_LCB_EVT* p_data) {
p_data->p_ccb->p_bcb = NULL;
(*p_data->p_ccb->cc.p_ctrl_cback)(avct_ccb_to_idx(p_data->p_ccb),
AVCT_BROWSE_DISCONN_CFM_EVT, 0, NULL);
@@ -220,7 +220,7 @@ void avct_bcb_open_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_open_fail(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_bcb_open_fail(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) {
tAVCT_CCB* p_ccb = &avct_cb.ccb[0];
for (int idx = 0; idx < AVCT_NUM_CONN; idx++, p_ccb++) {
@@ -241,7 +241,7 @@ void avct_bcb_open_fail(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_close_ind(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_bcb_close_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) {
tAVCT_CCB* p_ccb = &avct_cb.ccb[0];
tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb);
@@ -349,7 +349,7 @@ void avct_bcb_chk_disc(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_chnl_disc(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_bcb_chnl_disc(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) {
avct_l2c_br_disconnect(p_bcb->ch_lcid, 0);
}
@@ -364,7 +364,7 @@ void avct_bcb_chnl_disc(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_bind_fail(UNUSED_ATTR tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
+void avct_bcb_bind_fail(tAVCT_BCB* /* p_bcb */, tAVCT_LCB_EVT* p_data) {
p_data->p_ccb->p_bcb = NULL;
(*p_data->p_ccb->cc.p_ctrl_cback)(avct_ccb_to_idx(p_data->p_ccb),
AVCT_BROWSE_CONN_CFM_EVT, AVCT_RESULT_FAIL,
@@ -489,8 +489,7 @@ void avct_bcb_send_msg(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_bcb_free_msg_ind(UNUSED_ATTR tAVCT_BCB* p_bcb,
- tAVCT_LCB_EVT* p_data) {
+void avct_bcb_free_msg_ind(tAVCT_BCB* /* p_bcb */, tAVCT_LCB_EVT* p_data) {
if (p_data) osi_free_and_reset((void**)&p_data->p_buf);
}
@@ -594,7 +593,7 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avct_bcb_dealloc(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_bcb_dealloc(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* /* p_data */) {
tAVCT_CCB* p_ccb = &avct_cb.ccb[0];
log::verbose("{}", p_bcb->allocated);
diff --git a/system/stack/avct/avct_l2c.cc b/system/stack/avct/avct_l2c.cc
index 68b04cc5a0..5c9bfe4399 100644
--- a/system/stack/avct/avct_l2c.cc
+++ b/system/stack/avct/avct_l2c.cc
@@ -106,7 +106,7 @@ static bool avct_l2c_is_passive(tAVCT_LCB* p_lcb) {
*
******************************************************************************/
void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
- UNUSED_ATTR uint16_t psm, uint8_t id) {
+ uint16_t /* psm */, uint8_t id) {
tAVCT_LCB* p_lcb;
uint16_t result = L2CAP_CONN_OK;
diff --git a/system/stack/avct/avct_l2c_br.cc b/system/stack/avct/avct_l2c_br.cc
index 86bb97f394..b6e06a4046 100644
--- a/system/stack/avct/avct_l2c_br.cc
+++ b/system/stack/avct/avct_l2c_br.cc
@@ -109,7 +109,7 @@ static bool avct_l2c_br_is_passive(tAVCT_BCB* p_bcb) {
*
******************************************************************************/
void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
- UNUSED_ATTR uint16_t psm, uint8_t id) {
+ uint16_t /* psm */, uint8_t id) {
tAVCT_LCB* p_lcb;
uint16_t result = L2CAP_CONN_NO_RESOURCES;
tAVCT_BCB* p_bcb;
diff --git a/system/stack/avct/avct_lcb.cc b/system/stack/avct/avct_lcb.cc
index 3e9ba5e1a8..c75cf2c26a 100644
--- a/system/stack/avct/avct_lcb.cc
+++ b/system/stack/avct/avct_lcb.cc
@@ -304,7 +304,7 @@ tAVCT_LCB* avct_lcb_alloc(const RawAddress& bd_addr) {
* Returns void.
*
******************************************************************************/
-void avct_lcb_dealloc(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_lcb_dealloc(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) {
log::verbose("allocated: {}", p_lcb->allocated);
// Check if the LCB is still referenced
diff --git a/system/stack/avct/avct_lcb_act.cc b/system/stack/avct/avct_lcb_act.cc
index 7aaab2fa79..a3a1943c21 100644
--- a/system/stack/avct/avct_lcb_act.cc
+++ b/system/stack/avct/avct_lcb_act.cc
@@ -32,7 +32,6 @@
#include "device/include/device_iot_config.h"
#include "internal_include/bt_target.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h"
#include "stack/avct/avct_defs.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
@@ -181,7 +180,7 @@ static BT_HDR* avct_lcb_msg_asmbl(tAVCT_LCB* p_lcb, BT_HDR* p_buf) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) {
uint16_t result = AVCT_RESULT_FAIL;
p_lcb->ch_state = AVCT_CH_CONN;
@@ -205,7 +204,7 @@ void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_unbind_disc(UNUSED_ATTR tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
+void avct_lcb_unbind_disc(tAVCT_LCB* /* p_lcb */, tAVCT_LCB_EVT* p_data) {
avct_ccb_dealloc(p_data->p_ccb, AVCT_DISCONNECT_CFM_EVT, 0, NULL);
}
@@ -345,7 +344,7 @@ void avct_lcb_open_fail(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_close_ind(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_lcb_close_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) {
tAVCT_CCB* p_ccb = &avct_cb.ccb[0];
int i;
@@ -449,7 +448,7 @@ void avct_lcb_chk_disc(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_chnl_disc(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
+void avct_lcb_chnl_disc(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* /* p_data */) {
avct_l2c_disconnect(p_lcb->ch_lcid, 0);
}
@@ -464,7 +463,7 @@ void avct_lcb_chnl_disc(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_bind_fail(UNUSED_ATTR tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
+void avct_lcb_bind_fail(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
avct_ccb_dealloc(p_data->p_ccb, AVCT_CONNECT_CFM_EVT, AVCT_RESULT_FAIL, NULL);
DEVICE_IOT_CONFIG_ADDR_INT_ADD_ONE(p_lcb->peer_addr,
IOT_CONF_KEY_AVRCP_CONN_FAIL_COUNT);
@@ -517,7 +516,7 @@ void avct_lcb_cong_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_discard_msg(UNUSED_ATTR tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
+void avct_lcb_discard_msg(tAVCT_LCB* /* p_lcb */, tAVCT_LCB_EVT* p_data) {
log::warn("Dropping message");
osi_free_and_reset((void**)&p_data->ul_msg.p_buf);
}
@@ -630,8 +629,7 @@ void avct_lcb_send_msg(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avct_lcb_free_msg_ind(UNUSED_ATTR tAVCT_LCB* p_lcb,
- tAVCT_LCB_EVT* p_data) {
+void avct_lcb_free_msg_ind(tAVCT_LCB* /* p_lcb */, tAVCT_LCB_EVT* p_data) {
if (p_data == NULL) return;
osi_free_and_reset((void**)&p_data->p_buf);
diff --git a/system/stack/avdt/avdt_ccb.cc b/system/stack/avdt/avdt_ccb.cc
index da4a729b86..ca37a7ca50 100644
--- a/system/stack/avdt/avdt_ccb.cc
+++ b/system/stack/avdt/avdt_ccb.cc
@@ -491,7 +491,7 @@ void AvdtpCcb::Allocate(const RawAddress& peer_address) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_dealloc(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_dealloc(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
log::verbose("deallocated (index {}) peer={} p_ccb={}",
avdt_ccb_to_idx(p_ccb), p_ccb->peer_addr, fmt::ptr(p_ccb));
p_ccb->ResetCcb();
diff --git a/system/stack/avdt/avdt_ccb_act.cc b/system/stack/avdt/avdt_ccb_act.cc
index 38cf225558..cc2bfe66f8 100644
--- a/system/stack/avdt/avdt_ccb_act.cc
+++ b/system/stack/avdt/avdt_ccb_act.cc
@@ -77,7 +77,7 @@ static void avdt_ccb_clear_ccb(AvdtpCcb* p_ccb) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_chan_open(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_chan_open(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
avdt_ad_open_req(AVDT_CHAN_SIG, p_ccb, NULL, AVDT_INT);
}
@@ -92,7 +92,7 @@ void avdt_ccb_chan_open(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_chan_close(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_chan_close(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
/* close the transport channel used by this CCB */
avdt_ad_close_req(AVDT_CHAN_SIG, p_ccb, NULL);
}
@@ -108,7 +108,7 @@ void avdt_ccb_chan_close(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_chk_close(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_chk_close(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
int i;
AvdtpScb* p_scb = &(p_ccb->scb[0]);
@@ -643,7 +643,7 @@ void avdt_ccb_snd_suspend_rsp(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_clear_cmds(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_clear_cmds(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
int i;
AvdtpScb* p_scb = &(p_ccb->scb[0]);
uint8_t err_code = AVDT_ERR_CONNECT;
@@ -729,7 +729,7 @@ void avdt_ccb_cmd_fail(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_free_cmd(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_free_cmd(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
osi_free_and_reset((void**)&p_ccb->p_curr_cmd);
}
@@ -804,7 +804,7 @@ void avdt_ccb_ret_cmd(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_snd_cmd(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_snd_cmd(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
BT_HDR* p_msg;
/* do we have commands to send? send next command; make sure we're clear;
@@ -833,7 +833,7 @@ void avdt_ccb_snd_cmd(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_snd_msg(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_snd_msg(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
BT_HDR* p_msg;
/* if not congested */
@@ -869,7 +869,7 @@ void avdt_ccb_snd_msg(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_set_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_set_reconn(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
p_ccb->reconn = true;
}
@@ -883,7 +883,7 @@ void avdt_ccb_set_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_clr_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_clr_reconn(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
p_ccb->reconn = false;
}
@@ -899,7 +899,7 @@ void avdt_ccb_clr_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_chk_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_chk_reconn(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
if (p_ccb->reconn) {
p_ccb->reconn = false;
@@ -930,7 +930,7 @@ void avdt_ccb_chk_reconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_chk_timer(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_chk_timer(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
alarm_cancel(p_ccb->idle_ccb_timer);
}
@@ -979,7 +979,7 @@ void avdt_ccb_set_disconn(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_do_disconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_do_disconn(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
/* clear any pending commands */
avdt_ccb_clear_cmds(p_ccb, NULL);
@@ -997,7 +997,7 @@ void avdt_ccb_do_disconn(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
* Returns void.
*
******************************************************************************/
-void avdt_ccb_ll_closed(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
+void avdt_ccb_ll_closed(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* /* p_data */) {
tAVDT_CTRL_CBACK* p_cback;
tAVDT_CTRL avdt_ctrl;
diff --git a/system/stack/avdt/avdt_l2c.cc b/system/stack/avdt/avdt_l2c.cc
index 06aadbf3ca..a5c526e4ac 100644
--- a/system/stack/avdt/avdt_l2c.cc
+++ b/system/stack/avdt/avdt_l2c.cc
@@ -106,8 +106,7 @@ static void avdt_sec_check_complete_term(const RawAddress* bd_addr,
******************************************************************************/
static void avdt_sec_check_complete_orig(const RawAddress* bd_addr,
tBT_TRANSPORT trasnport,
- UNUSED_ATTR void* p_ref_data,
- uint8_t res) {
+ void* /* p_ref_data */, uint8_t res) {
AvdtpCcb* p_ccb = NULL;
AvdtpTransportChannel* p_tbl;
@@ -135,7 +134,7 @@ static void avdt_sec_check_complete_orig(const RawAddress* bd_addr,
*
******************************************************************************/
void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
- UNUSED_ATTR uint16_t psm, uint8_t id) {
+ uint16_t /* psm */, uint8_t id) {
AvdtpCcb* p_ccb;
AvdtpTransportChannel* p_tbl = NULL;
uint16_t result;
diff --git a/system/stack/avdt/avdt_msg.cc b/system/stack/avdt/avdt_msg.cc
index b99819295a..1a3ffbe209 100644
--- a/system/stack/avdt/avdt_msg.cc
+++ b/system/stack/avdt/avdt_msg.cc
@@ -332,8 +332,7 @@ static void avdt_msg_bld_cfg(uint8_t** p, AvdtpSepConfig* p_cfg) {
* Returns void.
*
******************************************************************************/
-static void avdt_msg_bld_none(UNUSED_ATTR uint8_t** p,
- UNUSED_ATTR tAVDT_MSG* p_msg) {
+static void avdt_msg_bld_none(uint8_t** /* p */, tAVDT_MSG* /* p_msg */) {
return;
}
@@ -675,9 +674,8 @@ static uint8_t avdt_msg_prs_cfg(AvdtpSepConfig* p_cfg, uint8_t* p, uint16_t len,
* Returns Error code or zero if no error.
*
******************************************************************************/
-static uint8_t avdt_msg_prs_none(UNUSED_ATTR tAVDT_MSG* p_msg,
- UNUSED_ATTR uint8_t* p,
- UNUSED_ATTR uint16_t len) {
+static uint8_t avdt_msg_prs_none(tAVDT_MSG* /* p_msg */, uint8_t* /* p */,
+ uint16_t /* len */) {
return 0;
}
diff --git a/system/stack/avdt/avdt_scb.cc b/system/stack/avdt/avdt_scb.cc
index 6eb620b8a2..1b2095560d 100644
--- a/system/stack/avdt/avdt_scb.cc
+++ b/system/stack/avdt/avdt_scb.cc
@@ -888,7 +888,7 @@ void AvdtpScb::Allocate(AvdtpCcb* p_avdtp_ccb,
* Returns void.
*
******************************************************************************/
-void avdt_scb_dealloc(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_dealloc(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
log::verbose("hdl={}", avdt_scb_to_hdl(p_scb));
p_scb->Recycle();
}
diff --git a/system/stack/avdt/avdt_scb_act.cc b/system/stack/avdt/avdt_scb_act.cc
index a802aeaff5..a425dee45a 100644
--- a/system/stack/avdt/avdt_scb_act.cc
+++ b/system/stack/avdt/avdt_scb_act.cc
@@ -99,8 +99,8 @@ void avdt_scb_hdl_abort_cmd(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_hdl_abort_rsp(UNUSED_ATTR AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_hdl_abort_rsp(AvdtpScb* /* p_scb */,
+ tAVDT_SCB_EVT* /* p_data */) {
return;
}
@@ -160,8 +160,8 @@ void avdt_scb_hdl_getconfig_cmd(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_hdl_getconfig_rsp(UNUSED_ATTR AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_hdl_getconfig_rsp(AvdtpScb* /* p_scb */,
+ tAVDT_SCB_EVT* /* p_data */) {
return;
}
@@ -206,7 +206,7 @@ void avdt_scb_hdl_open_rej(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_hdl_open_rsp(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_hdl_open_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
/* initiate opening of trans channels for this SEID */
p_scb->role = AVDT_OPEN_INT;
avdt_ad_open_req(AVDT_CHAN_MEDIA, p_scb->p_ccb, p_scb, AVDT_INT);
@@ -443,7 +443,7 @@ void avdt_scb_hdl_pkt(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_drop_pkt(UNUSED_ATTR AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
+void avdt_scb_drop_pkt(AvdtpScb* /* p_scb */, tAVDT_SCB_EVT* p_data) {
log::error("dropped incoming media packet");
osi_free_and_reset((void**)&p_data->p_pkt);
}
@@ -643,7 +643,7 @@ void avdt_scb_hdl_setconfig_rej(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
*
******************************************************************************/
void avdt_scb_snd_snk_delay_rpt_req(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+ tAVDT_SCB_EVT* /* p_data */) {
if (p_scb->p_ccb == NULL) {
return;
}
@@ -703,8 +703,7 @@ void avdt_scb_hdl_setconfig_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_hdl_start_cmd(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_hdl_start_cmd(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
(*p_scb->stream_config.p_avdt_ctrl_cback)(
avdt_scb_to_hdl(p_scb),
p_scb->p_ccb ? p_scb->p_ccb->peer_addr : RawAddress::kEmpty,
@@ -739,8 +738,7 @@ void avdt_scb_hdl_start_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_hdl_suspend_cmd(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_hdl_suspend_cmd(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
(*p_scb->stream_config.p_avdt_ctrl_cback)(
avdt_scb_to_hdl(p_scb),
p_scb->p_ccb ? p_scb->p_ccb->peer_addr : RawAddress::kEmpty,
@@ -1037,8 +1035,7 @@ void avdt_scb_hdl_write_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_abort_req(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_abort_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_EVT_HDR hdr;
log::verbose("p_scb->p_ccb={}", fmt::ptr(p_scb->p_ccb));
@@ -1063,8 +1060,7 @@ void avdt_scb_snd_abort_req(AvdtpScb* p_scb,
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_abort_rsp(UNUSED_ATTR AvdtpScb* p_scb,
- tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_abort_rsp(AvdtpScb* /* p_scb */, tAVDT_SCB_EVT* p_data) {
avdt_msg_send_rsp(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx), AVDT_SIG_ABORT,
&p_data->msg);
}
@@ -1078,8 +1074,7 @@ void avdt_scb_snd_abort_rsp(UNUSED_ATTR AvdtpScb* p_scb,
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_close_req(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_close_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_EVT_HDR hdr;
p_scb->role = AVDT_CLOSE_INT;
@@ -1127,8 +1122,7 @@ void avdt_scb_snd_close_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_getconfig_req(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_getconfig_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_EVT_HDR hdr;
hdr.seid = p_scb->peer_seid;
@@ -1160,7 +1154,7 @@ void avdt_scb_snd_getconfig_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_open_req(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_open_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_EVT_HDR hdr;
hdr.seid = p_scb->peer_seid;
@@ -1364,7 +1358,7 @@ void avdt_scb_snd_setconfig_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_snd_tc_close(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_snd_tc_close(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
if (p_scb->curr_cfg.psc_mask & AVDT_PSC_REPORT)
avdt_ad_close_req(AVDT_CHAN_REPORT, p_scb->p_ccb, p_scb);
avdt_ad_close_req(AVDT_CHAN_MEDIA, p_scb->p_ccb, p_scb);
@@ -1380,7 +1374,7 @@ void avdt_scb_snd_tc_close(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_cb_err(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_cb_err(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_CTRL avdt_ctrl;
/* set error code and parameter */
@@ -1418,7 +1412,7 @@ void avdt_scb_cong_state(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_rej_state(UNUSED_ATTR AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
+void avdt_scb_rej_state(AvdtpScb* /* p_scb */, tAVDT_SCB_EVT* p_data) {
p_data->msg.hdr.err_code = AVDT_ERR_BAD_STATE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1435,7 +1429,7 @@ void avdt_scb_rej_state(UNUSED_ATTR AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_rej_in_use(UNUSED_ATTR AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
+void avdt_scb_rej_in_use(AvdtpScb* /* p_scb */, tAVDT_SCB_EVT* p_data) {
p_data->msg.hdr.err_code = AVDT_ERR_IN_USE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1452,8 +1446,7 @@ void avdt_scb_rej_in_use(UNUSED_ATTR AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_rej_not_in_use(UNUSED_ATTR AvdtpScb* p_scb,
- tAVDT_SCB_EVT* p_data) {
+void avdt_scb_rej_not_in_use(AvdtpScb* /* p_scb */, tAVDT_SCB_EVT* p_data) {
p_data->msg.hdr.err_code = AVDT_ERR_NOT_IN_USE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1469,7 +1462,7 @@ void avdt_scb_rej_not_in_use(UNUSED_ATTR AvdtpScb* p_scb,
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_set_remove(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_set_remove(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
p_scb->remove = true;
}
@@ -1508,7 +1501,7 @@ void avdt_scb_free_pkt(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_clr_pkt(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_clr_pkt(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_CTRL avdt_ctrl;
AvdtpCcb* p_ccb;
uint8_t tcid;
@@ -1551,7 +1544,7 @@ void avdt_scb_clr_pkt(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_chk_snd_pkt(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_chk_snd_pkt(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
tAVDT_CTRL avdt_ctrl;
BT_HDR* p_pkt;
@@ -1582,7 +1575,7 @@ void avdt_scb_chk_snd_pkt(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
*
******************************************************************************/
void avdt_scb_transport_channel_timer(AvdtpScb* p_scb,
- UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+ tAVDT_SCB_EVT* /* p_data */) {
alarm_set_on_mloop(p_scb->transport_channel_timer,
AVDT_SCB_TC_DISC_TIMEOUT_MS,
avdt_scb_transport_channel_timer_timeout, p_scb);
@@ -1597,7 +1590,7 @@ void avdt_scb_transport_channel_timer(AvdtpScb* p_scb,
* Returns Nothing.
*
******************************************************************************/
-void avdt_scb_clr_vars(AvdtpScb* p_scb, UNUSED_ATTR tAVDT_SCB_EVT* p_data) {
+void avdt_scb_clr_vars(AvdtpScb* p_scb, tAVDT_SCB_EVT* /* p_data */) {
p_scb->in_use = false;
p_scb->peer_seid = 0;
}
diff --git a/system/stack/avrc/avrc_bld_tg.cc b/system/stack/avrc/avrc_bld_tg.cc
index 8662e8f6ed..af754bcd74 100644
--- a/system/stack/avrc/avrc_bld_tg.cc
+++ b/system/stack/avrc/avrc_bld_tg.cc
@@ -266,8 +266,8 @@ static tAVRC_STS avrc_bld_get_cur_app_setting_value_rsp(
* Otherwise, the error code.
*
******************************************************************************/
-static tAVRC_STS avrc_bld_set_app_setting_value_rsp(
- UNUSED_ATTR tAVRC_RSP* p_rsp, UNUSED_ATTR BT_HDR* p_pkt) {
+static tAVRC_STS avrc_bld_set_app_setting_value_rsp(tAVRC_RSP* /* p_rsp */,
+ BT_HDR* /* p_pkt */) {
/* nothing to be added. */
log::verbose("");
return AVRC_STS_NO_ERROR;
@@ -388,8 +388,8 @@ static tAVRC_STS avrc_bld_get_app_setting_value_text_rsp(
* Otherwise, the error code.
*
******************************************************************************/
-static tAVRC_STS avrc_bld_inform_charset_rsp(UNUSED_ATTR tAVRC_RSP* p_rsp,
- UNUSED_ATTR BT_HDR* p_pkt) {
+static tAVRC_STS avrc_bld_inform_charset_rsp(tAVRC_RSP* /* p_rsp */,
+ BT_HDR* /* p_pkt */) {
/* nothing to be added. */
log::verbose("");
return AVRC_STS_NO_ERROR;
@@ -406,8 +406,8 @@ static tAVRC_STS avrc_bld_inform_charset_rsp(UNUSED_ATTR tAVRC_RSP* p_rsp,
* Otherwise, the error code.
*
******************************************************************************/
-static tAVRC_STS avrc_bld_inform_battery_status_rsp(
- UNUSED_ATTR tAVRC_RSP* p_rsp, UNUSED_ATTR BT_HDR* p_pkt) {
+static tAVRC_STS avrc_bld_inform_battery_status_rsp(tAVRC_RSP* /* p_rsp */,
+ BT_HDR* /* p_pkt */) {
/* nothing to be added. */
log::verbose("");
return AVRC_STS_NO_ERROR;
diff --git a/system/stack/avrc/avrc_pars_ct.cc b/system/stack/avrc/avrc_pars_ct.cc
index 9f532aba10..d336354daa 100644
--- a/system/stack/avrc/avrc_pars_ct.cc
+++ b/system/stack/avrc/avrc_pars_ct.cc
@@ -879,8 +879,7 @@ tAVRC_STS AVRC_Ctrl_ParsResponse(tAVRC_MSG* p_msg, tAVRC_RESPONSE* p_result,
*
******************************************************************************/
tAVRC_STS AVRC_ParsResponse(tAVRC_MSG* p_msg, tAVRC_RESPONSE* p_result,
- UNUSED_ATTR uint8_t* p_buf,
- UNUSED_ATTR uint16_t buf_len) {
+ uint8_t* /* p_buf */, uint16_t /* buf_len */) {
tAVRC_STS status = AVRC_STS_INTERNAL_ERR;
uint16_t id;
diff --git a/system/stack/avrc/avrc_sdp.cc b/system/stack/avrc/avrc_sdp.cc
index 4f2d4b6594..1f6c2e8ac4 100644
--- a/system/stack/avrc/avrc_sdp.cc
+++ b/system/stack/avrc/avrc_sdp.cc
@@ -29,7 +29,6 @@
#include "avrc_api.h"
#include "avrc_int.h"
#include "os/log.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/include/bt_types.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/sdp_api.h"
@@ -67,7 +66,7 @@ static uint16_t a2dp_attr_list_sdp[] = {
* Returns Nothing.
*
*****************************************************************************/
-static void avrc_sdp_cback(UNUSED_ATTR const RawAddress& bd_addr,
+static void avrc_sdp_cback(const RawAddress& /* bd_addr */,
tSDP_STATUS status) {
log::verbose("status: {}", status);
diff --git a/system/stack/bnep/bnep_main.cc b/system/stack/bnep/bnep_main.cc
index 5f8f9da2a3..2358cc47f0 100644
--- a/system/stack/bnep/bnep_main.cc
+++ b/system/stack/bnep/bnep_main.cc
@@ -113,7 +113,7 @@ tBNEP_RESULT bnep_register_with_l2cap(void) {
*
******************************************************************************/
static void bnep_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
- UNUSED_ATTR uint16_t psm, uint8_t l2cap_id) {
+ uint16_t /* psm */, uint8_t l2cap_id) {
tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(bd_addr);
/* If we are not acting as server, or already have a connection, or have */
diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc
index 137232ea69..87055e8090 100644
--- a/system/stack/btm/btm_ble_gap.cc
+++ b/system/stack/btm/btm_ble_gap.cc
@@ -43,7 +43,6 @@
#include "main/shim/acl_api.h"
#include "main/shim/entry.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "osi/include/properties.h"
#include "osi/include/stack_power_telemetry.h"
#include "stack/acl/acl.h"
@@ -2755,7 +2754,7 @@ static tBTM_STATUS btm_ble_stop_adv(void) {
return BTM_SUCCESS;
}
-static void btm_ble_fast_adv_timer_timeout(UNUSED_ATTR void* data) {
+static void btm_ble_fast_adv_timer_timeout(void* /* data */) {
/* fast adv is completed, fall back to slow adv interval */
btm_ble_start_slow_adv();
}
@@ -2793,18 +2792,18 @@ static void btm_ble_start_slow_adv(void) {
}
static void btm_ble_inquiry_timer_gap_limited_discovery_timeout(
- UNUSED_ATTR void* data) {
+ void* /* data */) {
/* lim_timeout expired, limited discovery should exit now */
btm_cb.btm_inq_vars.discoverable_mode &= ~BTM_BLE_LIMITED_DISCOVERABLE;
btm_ble_set_adv_flag(btm_cb.btm_inq_vars.connectable_mode,
btm_cb.btm_inq_vars.discoverable_mode);
}
-static void btm_ble_inquiry_timer_timeout(UNUSED_ATTR void* data) {
+static void btm_ble_inquiry_timer_timeout(void* /* data */) {
btm_ble_stop_inquiry();
}
-static void btm_ble_observer_timer_timeout(UNUSED_ATTR void* data) {
+static void btm_ble_observer_timer_timeout(void* /* data */) {
btm_ble_stop_observe();
}
diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc
index 59e7de8c1d..9afa99555e 100644
--- a/system/stack/btm/btm_devctl.cc
+++ b/system/stack/btm/btm_devctl.cc
@@ -247,7 +247,7 @@ bool BTM_IsDeviceUp(void) {
* Returns void
*
******************************************************************************/
-static void btm_read_local_name_timeout(UNUSED_ATTR void* data) {
+static void btm_read_local_name_timeout(void* /* data */) {
tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_rln_cmpl_cb;
btm_cb.devcb.p_rln_cmpl_cb = NULL;
if (p_cb) (*p_cb)((void*)NULL);
@@ -395,7 +395,7 @@ tBTM_STATUS BTM_ReadLocalDeviceNameFromController(
* Returns void
*
******************************************************************************/
-void btm_read_local_name_complete(uint8_t* p, UNUSED_ATTR uint16_t evt_len) {
+void btm_read_local_name_complete(uint8_t* p, uint16_t /* evt_len */) {
tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_rln_cmpl_cb;
uint8_t status;
diff --git a/system/stack/btm/btm_inq.cc b/system/stack/btm/btm_inq.cc
index 1ec035f64c..8e6597ae92 100644
--- a/system/stack/btm/btm_inq.cc
+++ b/system/stack/btm/btm_inq.cc
@@ -588,7 +588,7 @@ void BTM_CancelInquiry(void) {
}
}
-static void btm_classic_inquiry_timeout(UNUSED_ATTR void* data) {
+static void btm_classic_inquiry_timeout(void* /* data */) {
// When the Inquiry Complete event is received, the classic inquiry
// will be marked as completed. Therefore, we only need to mark
// the BLE inquiry as completed here to stop processing BLE results
@@ -2001,7 +2001,7 @@ void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn,
}
}
-void btm_inq_remote_name_timer_timeout(UNUSED_ATTR void* data) {
+void btm_inq_remote_name_timer_timeout(void* /* data */) {
btm_inq_rmt_name_failed_cancelled();
}
diff --git a/system/stack/btu/btu_hcif.cc b/system/stack/btu/btu_hcif.cc
index 15d033e7dc..758a94ce81 100644
--- a/system/stack/btu/btu_hcif.cc
+++ b/system/stack/btu/btu_hcif.cc
@@ -213,8 +213,7 @@ static void btu_hcif_log_event_metrics(uint8_t evt_code,
* Returns void
*
******************************************************************************/
-void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id,
- const BT_HDR* p_msg) {
+void btu_hcif_process_event(uint8_t /* controller_id */, const BT_HDR* p_msg) {
uint8_t* p = (uint8_t*)(p_msg + 1) + p_msg->offset;
uint8_t hci_evt_code, hci_evt_len;
uint8_t ble_sub_code;
@@ -579,7 +578,7 @@ static void btu_hcif_log_command_metrics(uint16_t opcode, const uint8_t* p_cmd,
* Returns void
*
******************************************************************************/
-void btu_hcif_send_cmd(UNUSED_ATTR uint8_t controller_id, const BT_HDR* p_buf) {
+void btu_hcif_send_cmd(uint8_t /* controller_id */, const BT_HDR* p_buf) {
if (!p_buf) return;
uint16_t opcode;
diff --git a/system/stack/gatt/gatt_attr.cc b/system/stack/gatt/gatt_attr.cc
index 3da14d664d..d03348c147 100644
--- a/system/stack/gatt/gatt_attr.cc
+++ b/system/stack/gatt/gatt_attr.cc
@@ -37,7 +37,6 @@
#include "internal_include/bt_trace.h"
#include "os/log.h"
#include "os/logging/log_adapter.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/include/bt_types.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_sec_api.h"
@@ -72,9 +71,9 @@ static std::map<uint16_t, std::deque<gatt_op_cb_data>> OngoingOps;
static void gatt_request_cback(uint16_t conn_id, uint32_t trans_id,
uint8_t op_code, tGATTS_DATA* p_data);
-static void gatt_connect_cback(UNUSED_ATTR tGATT_IF gatt_if,
- const RawAddress& bda, uint16_t conn_id,
- bool connected, tGATT_DISCONN_REASON reason,
+static void gatt_connect_cback(tGATT_IF /* gatt_if */, const RawAddress& bda,
+ uint16_t conn_id, bool connected,
+ tGATT_DISCONN_REASON reason,
tBT_TRANSPORT transport);
static void gatt_disc_res_cback(uint16_t conn_id, tGATT_DISC_TYPE disc_type,
tGATT_DISC_RES* p_data);
@@ -351,9 +350,9 @@ static void gatt_request_cback(uint16_t conn_id, uint32_t trans_id,
* Returns void
*
******************************************************************************/
-static void gatt_connect_cback(UNUSED_ATTR tGATT_IF gatt_if,
- const RawAddress& bda, uint16_t conn_id,
- bool connected, tGATT_DISCONN_REASON reason,
+static void gatt_connect_cback(tGATT_IF /* gatt_if */, const RawAddress& bda,
+ uint16_t conn_id, bool connected,
+ tGATT_DISCONN_REASON reason,
tBT_TRANSPORT transport) {
log::verbose("from {} connected: {}, conn_id: {}", bda, connected,
loghex(conn_id));
diff --git a/system/stack/gatt/gatt_auth.cc b/system/stack/gatt/gatt_auth.cc
index 828dfbf721..f0c8029418 100644
--- a/system/stack/gatt/gatt_auth.cc
+++ b/system/stack/gatt/gatt_auth.cc
@@ -156,8 +156,7 @@ static void gatt_sec_check_complete(bool sec_check_ok, tGATT_CLCB* p_clcb,
*
******************************************************************************/
static void gatt_enc_cmpl_cback(const RawAddress* bd_addr,
- tBT_TRANSPORT transport,
- UNUSED_ATTR void* p_ref_data,
+ tBT_TRANSPORT transport, void* /* p_ref_data */,
tBTM_STATUS result) {
log::verbose("");
tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(*bd_addr, transport);
diff --git a/system/stack/gatt/gatt_cl.cc b/system/stack/gatt/gatt_cl.cc
index 635e1e65d6..f3fe788197 100644
--- a/system/stack/gatt/gatt_cl.cc
+++ b/system/stack/gatt/gatt_cl.cc
@@ -388,9 +388,8 @@ void gatt_send_prepare_write(tGATT_TCB& tcb, tGATT_CLCB* p_clcb) {
* Returns void
*
******************************************************************************/
-void gatt_process_find_type_value_rsp(UNUSED_ATTR tGATT_TCB& tcb,
- tGATT_CLCB* p_clcb, uint16_t len,
- uint8_t* p_data) {
+void gatt_process_find_type_value_rsp(tGATT_TCB& /* tcb */, tGATT_CLCB* p_clcb,
+ uint16_t len, uint8_t* p_data) {
tGATT_DISC_RES result;
uint8_t* p = p_data;
@@ -435,8 +434,8 @@ void gatt_process_find_type_value_rsp(UNUSED_ATTR tGATT_TCB& tcb,
* Returns void
*
******************************************************************************/
-void gatt_process_read_info_rsp(UNUSED_ATTR tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
- UNUSED_ATTR uint8_t op_code, uint16_t len,
+void gatt_process_read_info_rsp(tGATT_TCB& /* tcb */, tGATT_CLCB* p_clcb,
+ uint8_t /* op_code */, uint16_t len,
uint8_t* p_data) {
tGATT_DISC_RES result;
uint8_t *p = p_data, uuid_len = 0, type;
@@ -489,8 +488,8 @@ void gatt_process_read_info_rsp(UNUSED_ATTR tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
* Returns void.
*
******************************************************************************/
-void gatt_proc_disc_error_rsp(UNUSED_ATTR tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
- uint8_t opcode, UNUSED_ATTR uint16_t handle,
+void gatt_proc_disc_error_rsp(tGATT_TCB& /* tcb */, tGATT_CLCB* p_clcb,
+ uint8_t opcode, uint16_t /* handle */,
uint8_t reason) {
tGATT_STATUS status = (tGATT_STATUS)reason;
@@ -525,8 +524,8 @@ void gatt_proc_disc_error_rsp(UNUSED_ATTR tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
*
******************************************************************************/
void gatt_process_error_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
- UNUSED_ATTR uint8_t op_code,
- UNUSED_ATTR uint16_t len, uint8_t* p_data) {
+ uint8_t /* op_code */, uint16_t len,
+ uint8_t* p_data) {
uint8_t opcode, *p = p_data;
uint8_t reason;
uint16_t handle;
@@ -995,7 +994,7 @@ void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
*
******************************************************************************/
void gatt_process_read_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb,
- UNUSED_ATTR uint8_t op_code, uint16_t len,
+ uint8_t /* op_code */, uint16_t len,
uint8_t* p_data) {
uint16_t offset = p_clcb->counter;
uint8_t* p = p_data;
diff --git a/system/stack/gatt/gatt_db.cc b/system/stack/gatt/gatt_db.cc
index 19daa95848..a8a9b4083c 100644
--- a/system/stack/gatt/gatt_db.cc
+++ b/system/stack/gatt/gatt_db.cc
@@ -76,7 +76,7 @@ Uuid* gatts_get_service_uuid(tGATT_SVC_DB* p_db) {
/** Check attribute readability. Returns status of operation. */
static tGATT_STATUS gatts_check_attr_readability(const tGATT_ATTR& attr,
- UNUSED_ATTR uint16_t offset,
+ uint16_t /* offset */,
bool read_long,
tGATT_SEC_FLAG sec_flag,
uint8_t key_size) {
diff --git a/system/stack/gatt/gatt_main.cc b/system/stack/gatt/gatt_main.cc
index 03709a4ba2..453e0b965d 100644
--- a/system/stack/gatt/gatt_main.cc
+++ b/system/stack/gatt/gatt_main.cc
@@ -762,8 +762,8 @@ static void gatt_le_data_ind(uint16_t chan, const RawAddress& bd_addr,
*
******************************************************************************/
static void gatt_l2cif_connect_ind_cback(const RawAddress& bd_addr,
- uint16_t lcid,
- UNUSED_ATTR uint16_t psm, uint8_t id) {
+ uint16_t lcid, uint16_t /* psm */,
+ uint8_t id) {
uint8_t result = L2CAP_CONN_OK;
log::info("Connection indication cid = {}", lcid);
diff --git a/system/stack/gatt/gatt_sr.cc b/system/stack/gatt/gatt_sr.cc
index 94b7efc405..96c930a7f9 100644
--- a/system/stack/gatt/gatt_sr.cc
+++ b/system/stack/gatt/gatt_sr.cc
@@ -305,9 +305,8 @@ static bool process_read_multi_rsp(tGATT_SR_CMD* p_cmd, tGATT_STATUS status,
*
******************************************************************************/
tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if,
- UNUSED_ATTR uint32_t trans_id,
- uint8_t op_code, tGATT_STATUS status,
- tGATTS_RSP* p_msg,
+ uint32_t /* trans_id */, uint8_t op_code,
+ tGATT_STATUS status, tGATTS_RSP* p_msg,
tGATT_SR_CMD* sr_res_p) {
tGATT_STATUS ret_code = GATT_SUCCESS;
uint16_t payload_size = gatt_tcb_get_payload_size(tcb, sr_res_p->cid);
@@ -547,8 +546,7 @@ void gatt_process_read_multi_req(tGATT_TCB& tcb, uint16_t cid, uint8_t op_code,
******************************************************************************/
static tGATT_STATUS gatt_build_primary_service_rsp(
BT_HDR* p_msg, tGATT_TCB& tcb, uint16_t cid, uint8_t op_code,
- uint16_t s_hdl, uint16_t e_hdl, UNUSED_ATTR uint8_t* p_data,
- const Uuid& value) {
+ uint16_t s_hdl, uint16_t e_hdl, uint8_t* /* p_data */, const Uuid& value) {
tGATT_STATUS status = GATT_NOT_FOUND;
uint8_t handle_len = 4;
diff --git a/system/stack/hid/hidh_api.cc b/system/stack/hid/hidh_api.cc
index b78dcc0a28..28246fcfc6 100644
--- a/system/stack/hid/hidh_api.cc
+++ b/system/stack/hid/hidh_api.cc
@@ -36,7 +36,6 @@
#include "internal_include/bt_target.h"
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/sdpdefs.h"
@@ -114,7 +113,7 @@ void hidh_get_str_attr(tSDP_DISC_REC* p_rec, uint16_t attr_id, uint16_t max_len,
str[0] = '\0';
}
-static void hidh_search_callback(UNUSED_ATTR const RawAddress& bd_addr,
+static void hidh_search_callback(const RawAddress& /* bd_addr */,
tSDP_RESULT sdp_result) {
tSDP_DISCOVERY_DB* p_db = hh_cb.p_sdp_db;
tSDP_DISC_REC* p_rec;
diff --git a/system/stack/include/btu_hcif.h b/system/stack/include/btu_hcif.h
index dc1c037877..5c7fc702e5 100644
--- a/system/stack/include/btu_hcif.h
+++ b/system/stack/include/btu_hcif.h
@@ -21,16 +21,13 @@
#include <cstdint>
-#include "include/hardware/bluetooth.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/include/bt_hdr.h"
/* Functions provided by btu_hcif.cc
***********************************
*/
-void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id,
- const BT_HDR* p_buf);
-void btu_hcif_send_cmd(UNUSED_ATTR uint8_t controller_id, const BT_HDR* p_msg);
+void btu_hcif_process_event(uint8_t controller_id, const BT_HDR* p_buf);
+void btu_hcif_send_cmd(uint8_t controller_id, const BT_HDR* p_msg);
void btu_hcif_send_cmd_with_cb(const base::Location& posted_from,
uint16_t opcode, uint8_t* params,
uint8_t params_len,
diff --git a/system/stack/l2cap/l2c_link.cc b/system/stack/l2cap/l2c_link.cc
index 90450f0d04..8af38df972 100644
--- a/system/stack/l2cap/l2c_link.cc
+++ b/system/stack/l2cap/l2c_link.cc
@@ -34,7 +34,6 @@
#include "internal_include/bt_target.h"
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h"
#include "stack/btm/btm_int_types.h"
#include "stack/include/acl_api.h"
#include "stack/include/bt_hdr.h"
@@ -187,9 +186,8 @@ void l2c_link_hci_conn_comp(tHCI_STATUS status, uint16_t handle,
* Returns void
*
******************************************************************************/
-void l2c_link_sec_comp(const RawAddress* p_bda,
- UNUSED_ATTR tBT_TRANSPORT transport, void* p_ref_data,
- tBTM_STATUS status) {
+void l2c_link_sec_comp(const RawAddress* p_bda, tBT_TRANSPORT transport,
+ void* p_ref_data, tBTM_STATUS status) {
tL2C_CONN_INFO ci;
tL2C_LCB* p_lcb;
tL2C_CCB* p_ccb;
diff --git a/system/stack/pan/pan_main.cc b/system/stack/pan/pan_main.cc
index 28d1291ac3..f9f855a8fb 100644
--- a/system/stack/pan/pan_main.cc
+++ b/system/stack/pan/pan_main.cc
@@ -33,7 +33,6 @@
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/include/bnep_api.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
@@ -283,8 +282,7 @@ void pan_conn_ind_cb(uint16_t handle, const RawAddress& p_bda,
* Returns none
*
******************************************************************************/
-void pan_connect_state_cb(uint16_t handle,
- UNUSED_ATTR const RawAddress& rem_bda,
+void pan_connect_state_cb(uint16_t handle, const RawAddress& /* rem_bda */,
tBNEP_RESULT result, bool is_role_change) {
tPAN_CONN* pcb;
uint8_t peer_role;
diff --git a/system/stack/rfcomm/rfc_port_fsm.cc b/system/stack/rfcomm/rfc_port_fsm.cc
index 66eaa92249..a836cafbed 100644
--- a/system/stack/rfcomm/rfc_port_fsm.cc
+++ b/system/stack/rfcomm/rfc_port_fsm.cc
@@ -33,7 +33,6 @@
#include "main/shim/entry.h"
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "stack/btm/btm_sec.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
@@ -875,8 +874,7 @@ void rfc_process_rls(tRFC_MCB* p_mcb, bool is_command, MX_FRAME* p_frame) {
* Description This function handles None Supported Command frame.
*
******************************************************************************/
-void rfc_process_nsc(UNUSED_ATTR tRFC_MCB* p_mcb,
- UNUSED_ATTR MX_FRAME* p_frame) {}
+void rfc_process_nsc(tRFC_MCB* /* p_mcb */, MX_FRAME* /* p_frame */) {}
/*******************************************************************************
*
@@ -886,7 +884,7 @@ void rfc_process_nsc(UNUSED_ATTR tRFC_MCB* p_mcb,
* reply to it. Otherwise pass response to the user.
*
******************************************************************************/
-void rfc_process_test_rsp(UNUSED_ATTR tRFC_MCB* p_mcb, BT_HDR* p_buf) {
+void rfc_process_test_rsp(tRFC_MCB* /* p_mcb */, BT_HDR* p_buf) {
osi_free(p_buf);
}
diff --git a/system/stack/smp/smp_keys.cc b/system/stack/smp/smp_keys.cc
index 000d777352..49c76cb27c 100644
--- a/system/stack/smp/smp_keys.cc
+++ b/system/stack/smp/smp_keys.cc
@@ -143,7 +143,7 @@ void smp_proc_passkey(tSMP_CB* p_cb, uint64_t rand) {
* Returns void
*
******************************************************************************/
-void smp_generate_passkey(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
+void smp_generate_passkey(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) {
log::verbose("addr:{}", p_cb->pairing_bda);
/* generate MRand or SRand */
send_ble_rand(BindOnce(&smp_proc_passkey, p_cb));
@@ -160,7 +160,7 @@ void smp_generate_passkey(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
* Returns void
*
******************************************************************************/
-void smp_generate_stk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
+void smp_generate_stk(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) {
Octet16 output;
log::verbose("addr:{}", p_cb->pairing_bda);
@@ -198,7 +198,7 @@ void smp_compute_csrk(uint16_t div, tSMP_CB* p_cb) {
/**
* This function is called to calculate CSRK, starting with DIV generation.
*/
-void smp_generate_csrk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
+void smp_generate_csrk(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) {
bool div_status;
log::verbose("addr:{}", p_cb->pairing_bda);
@@ -404,7 +404,7 @@ static void smp_generate_confirm(tSMP_CB* p_cb) {
*
******************************************************************************/
void smp_generate_srand_mrand_confirm(tSMP_CB* p_cb,
- UNUSED_ATTR tSMP_INT_DATA* p_data) {
+ tSMP_INT_DATA* /* p_data */) {
log::verbose("addr:{}", p_cb->pairing_bda);
/* generate MRand or SRand */
send_ble_rand(BindOnce(
@@ -434,7 +434,7 @@ void smp_generate_srand_mrand_confirm(tSMP_CB* p_cb,
* Returns void
*
******************************************************************************/
-void smp_generate_compare(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
+void smp_generate_compare(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) {
log::verbose("addr:{}", p_cb->pairing_bda);
smp_debug_print_nbyte_little_endian(p_cb->rrand, "peer rand", 16);
Octet16 output;
@@ -543,7 +543,7 @@ static void smp_generate_ltk_cont(uint16_t div, tSMP_CB* p_cb) {
* Returns void
*
******************************************************************************/
-void smp_generate_ltk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
+void smp_generate_ltk(tSMP_CB* p_cb, tSMP_INT_DATA* /* p_data */) {
log::verbose("addr:{}", p_cb->pairing_bda);
if (smp_get_br_state() == SMP_BR_STATE_BOND_PENDING) {
diff --git a/system/stack/smp/smp_l2c.cc b/system/stack/smp/smp_l2c.cc
index 2a41ee6a52..39bad0f09c 100644
--- a/system/stack/smp/smp_l2c.cc
+++ b/system/stack/smp/smp_l2c.cc
@@ -30,7 +30,6 @@
#include "internal_include/bt_target.h"
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h" // UNUSED_ATTR
#include "smp_int.h"
#include "stack/btm/btm_dev.h"
#include "stack/include/bt_hdr.h"
@@ -92,9 +91,9 @@ void smp_l2cap_if_init(void) {
* connected (conn = true)/disconnected (conn = false).
*
******************************************************************************/
-static void smp_connect_callback(UNUSED_ATTR uint16_t channel,
+static void smp_connect_callback(uint16_t /* channel */,
const RawAddress& bd_addr, bool connected,
- UNUSED_ATTR uint16_t reason,
+ uint16_t /* reason */,
tBT_TRANSPORT transport) {
tSMP_CB* p_cb = &smp_cb;
tSMP_INT_DATA int_data;
diff --git a/system/stack/smp/smp_utils.cc b/system/stack/smp/smp_utils.cc
index b6f31cf286..16a495e47f 100644
--- a/system/stack/smp/smp_utils.cc
+++ b/system/stack/smp/smp_utils.cc
@@ -37,7 +37,6 @@
#include "main/shim/helpers.h"
#include "os/log.h"
#include "osi/include/allocator.h"
-#include "osi/include/osi.h"
#include "p_256_ecc_pp.h"
#include "smp_int.h"
#include "stack/btm/btm_ble_sec.h"
@@ -158,31 +157,21 @@ static const tSMP_CMD_PARAM_RANGES_VALID smp_cmd_param_ranges_are_valid[] = {
typedef BT_HDR* (*tSMP_CMD_ACT)(uint8_t cmd_code, tSMP_CB* p_cb);
static BT_HDR* smp_build_pairing_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
-static BT_HDR* smp_build_confirm_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_rand_cmd(UNUSED_ATTR uint8_t cmd_code, tSMP_CB* p_cb);
-static BT_HDR* smp_build_pairing_fail(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_identity_info_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_encrypt_info_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_security_request(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_signing_info_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_central_id_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_id_addr_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_pair_public_key_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_pairing_commitment_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_confirm_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_rand_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_pairing_fail(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_identity_info_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_encrypt_info_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_security_request(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_signing_info_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_central_id_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_id_addr_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_pair_public_key_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_pairing_commitment_cmd(uint8_t cmd_code,
tSMP_CB* p_cb);
-static BT_HDR* smp_build_pair_dhkey_check_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb);
-static BT_HDR* smp_build_pairing_keypress_notification_cmd(
- UNUSED_ATTR uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_pair_dhkey_check_cmd(uint8_t cmd_code, tSMP_CB* p_cb);
+static BT_HDR* smp_build_pairing_keypress_notification_cmd(uint8_t cmd_code,
+ tSMP_CB* p_cb);
static const tSMP_CMD_ACT smp_cmd_build_act[] = {
NULL,
@@ -461,7 +450,7 @@ bool smp_send_cmd(uint8_t cmd_code, tSMP_CB* p_cb) {
* Returns void
*
******************************************************************************/
-void smp_rsp_timeout(UNUSED_ATTR void* data) {
+void smp_rsp_timeout(void* /* data */) {
tSMP_CB* p_cb = &smp_cb;
log::verbose("state:{} br_state:{}", p_cb->state, p_cb->br_state);
@@ -485,7 +474,7 @@ void smp_rsp_timeout(UNUSED_ATTR void* data) {
* Returns void
*
******************************************************************************/
-void smp_delayed_auth_complete_timeout(UNUSED_ATTR void* data) {
+void smp_delayed_auth_complete_timeout(void* /* data */) {
/*
* Waited for potential pair failure. Send SMP_AUTH_CMPL_EVT if
* the state is still in bond pending.
@@ -536,8 +525,7 @@ BT_HDR* smp_build_pairing_cmd(uint8_t cmd_code, tSMP_CB* p_cb) {
* Description Build confirm request command.
*
******************************************************************************/
-static BT_HDR* smp_build_confirm_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb) {
+static BT_HDR* smp_build_confirm_cmd(uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_CONFIRM_CMD_SIZE +
L2CAP_MIN_OFFSET);
@@ -562,7 +550,7 @@ static BT_HDR* smp_build_confirm_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build Random command.
*
******************************************************************************/
-static BT_HDR* smp_build_rand_cmd(UNUSED_ATTR uint8_t cmd_code, tSMP_CB* p_cb) {
+static BT_HDR* smp_build_rand_cmd(uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_RAND_CMD_SIZE +
L2CAP_MIN_OFFSET);
@@ -586,7 +574,7 @@ static BT_HDR* smp_build_rand_cmd(UNUSED_ATTR uint8_t cmd_code, tSMP_CB* p_cb) {
* Description Build security information command.
*
******************************************************************************/
-static BT_HDR* smp_build_encrypt_info_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_encrypt_info_cmd(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_ENC_INFO_SIZE +
@@ -611,8 +599,7 @@ static BT_HDR* smp_build_encrypt_info_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build security information command.
*
******************************************************************************/
-static BT_HDR* smp_build_central_id_cmd(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb) {
+static BT_HDR* smp_build_central_id_cmd(uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_CENTRAL_ID_SIZE +
L2CAP_MIN_OFFSET);
@@ -637,8 +624,8 @@ static BT_HDR* smp_build_central_id_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build identity information command.
*
******************************************************************************/
-static BT_HDR* smp_build_identity_info_cmd(UNUSED_ATTR uint8_t cmd_code,
- UNUSED_ATTR tSMP_CB* p_cb) {
+static BT_HDR* smp_build_identity_info_cmd(uint8_t /* cmd_code */,
+ tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf =
(BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_ID_INFO_SIZE + L2CAP_MIN_OFFSET);
@@ -665,8 +652,7 @@ static BT_HDR* smp_build_identity_info_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build identity address information command.
*
******************************************************************************/
-static BT_HDR* smp_build_id_addr_cmd(UNUSED_ATTR uint8_t cmd_code,
- UNUSED_ATTR tSMP_CB* p_cb) {
+static BT_HDR* smp_build_id_addr_cmd(uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf =
(BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_ID_ADDR_SIZE + L2CAP_MIN_OFFSET);
@@ -692,7 +678,7 @@ static BT_HDR* smp_build_id_addr_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build signing information command.
*
******************************************************************************/
-static BT_HDR* smp_build_signing_info_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_signing_info_cmd(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_SIGN_INFO_SIZE +
@@ -717,8 +703,7 @@ static BT_HDR* smp_build_signing_info_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build Pairing Fail command.
*
******************************************************************************/
-static BT_HDR* smp_build_pairing_fail(UNUSED_ATTR uint8_t cmd_code,
- tSMP_CB* p_cb) {
+static BT_HDR* smp_build_pairing_fail(uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_PAIR_FAIL_SIZE +
L2CAP_MIN_OFFSET);
@@ -742,7 +727,7 @@ static BT_HDR* smp_build_pairing_fail(UNUSED_ATTR uint8_t cmd_code,
* Description Build security request command.
*
******************************************************************************/
-static BT_HDR* smp_build_security_request(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_security_request(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + 2 + L2CAP_MIN_OFFSET);
@@ -769,7 +754,7 @@ static BT_HDR* smp_build_security_request(UNUSED_ATTR uint8_t cmd_code,
* Description Build pairing public key command.
*
******************************************************************************/
-static BT_HDR* smp_build_pair_public_key_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_pair_public_key_cmd(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
uint8_t publ_key[2 * BT_OCTET32_LEN];
@@ -799,7 +784,7 @@ static BT_HDR* smp_build_pair_public_key_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build pairing commitment command.
*
******************************************************************************/
-static BT_HDR* smp_build_pairing_commitment_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_pairing_commitment_cmd(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + SMP_PAIR_COMMITM_SIZE +
@@ -824,7 +809,7 @@ static BT_HDR* smp_build_pairing_commitment_cmd(UNUSED_ATTR uint8_t cmd_code,
* Description Build pairing DHKey check command.
*
******************************************************************************/
-static BT_HDR* smp_build_pair_dhkey_check_cmd(UNUSED_ATTR uint8_t cmd_code,
+static BT_HDR* smp_build_pair_dhkey_check_cmd(uint8_t /* cmd_code */,
tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(
@@ -850,7 +835,7 @@ static BT_HDR* smp_build_pair_dhkey_check_cmd(UNUSED_ATTR uint8_t cmd_code,
*
******************************************************************************/
static BT_HDR* smp_build_pairing_keypress_notification_cmd(
- UNUSED_ATTR uint8_t cmd_code, tSMP_CB* p_cb) {
+ uint8_t /* cmd_code */, tSMP_CB* p_cb) {
uint8_t* p;
BT_HDR* p_buf = (BT_HDR*)osi_malloc(
sizeof(BT_HDR) + SMP_PAIR_KEYPR_NOTIF_SIZE + L2CAP_MIN_OFFSET);
@@ -1250,9 +1235,7 @@ bool smp_pairing_keypress_notification_is_valid(tSMP_CB* p_cb) {
* Description Always returns true.
*
******************************************************************************/
-bool smp_parameter_unconditionally_valid(UNUSED_ATTR tSMP_CB* p_cb) {
- return true;
-}
+bool smp_parameter_unconditionally_valid(tSMP_CB* /* p_cb */) { return true; }
/*******************************************************************************
*
@@ -1261,7 +1244,7 @@ bool smp_parameter_unconditionally_valid(UNUSED_ATTR tSMP_CB* p_cb) {
* Description Always returns false.
*
******************************************************************************/
-bool smp_parameter_unconditionally_invalid(UNUSED_ATTR tSMP_CB* p_cb) {
+bool smp_parameter_unconditionally_invalid(tSMP_CB* /* p_cb */) {
return false;
}
diff --git a/system/stack/srvc/srvc_dis.cc b/system/stack/srvc/srvc_dis.cc
index dc3a3461c2..a55dc6ac85 100644
--- a/system/stack/srvc/srvc_dis.cc
+++ b/system/stack/srvc/srvc_dis.cc
@@ -110,7 +110,7 @@ bool dis_valid_handle_range(uint16_t handle) {
*
* Process write DIS attribute request.
******************************************************************************/
-uint8_t dis_write_attr_value(UNUSED_ATTR tGATT_WRITE_REQ* p_data,
+uint8_t dis_write_attr_value(tGATT_WRITE_REQ* /* p_data */,
tGATT_STATUS* p_status) {
*p_status = GATT_WRITE_NOT_PERMIT;
return SRVC_ACT_RSP;
@@ -118,7 +118,7 @@ uint8_t dis_write_attr_value(UNUSED_ATTR tGATT_WRITE_REQ* p_data,
/*******************************************************************************
* DIS Attributes Database Server Request callback
******************************************************************************/
-uint8_t dis_read_attr_value(UNUSED_ATTR uint8_t clcb_idx, uint16_t handle,
+uint8_t dis_read_attr_value(uint8_t /* clcb_idx */, uint16_t handle,
tGATT_VALUE* p_value, bool is_long,
tGATT_STATUS* p_status) {
tDIS_DB_ENTRY* p_db_attr = dis_cb.dis_attr;
diff --git a/system/stack/srvc/srvc_eng.cc b/system/stack/srvc/srvc_eng.cc
index 7786a7c52c..44d0951d0a 100644
--- a/system/stack/srvc/srvc_eng.cc
+++ b/system/stack/srvc/srvc_eng.cc
@@ -33,7 +33,7 @@ using namespace bluetooth;
static void srvc_eng_s_request_cback(uint16_t conn_id, uint32_t trans_id,
tGATTS_REQ_TYPE type, tGATTS_DATA* p_data);
-static void srvc_eng_connect_cback(UNUSED_ATTR tGATT_IF gatt_if,
+static void srvc_eng_connect_cback(tGATT_IF /* gatt_if */,
const RawAddress& bda, uint16_t conn_id,
bool connected, tGATT_DISCONN_REASON reason,
tBT_TRANSPORT transport);
@@ -210,7 +210,7 @@ static uint8_t srvc_eng_process_read_req(uint8_t clcb_idx,
******************************************************************************/
static uint8_t srvc_eng_process_write_req(uint8_t clcb_idx,
tGATT_WRITE_REQ* p_data,
- UNUSED_ATTR tGATTS_RSP* p_rsp,
+ tGATTS_RSP* /* p_rsp */,
tGATT_STATUS* p_status) {
uint8_t act = SRVC_ACT_RSP;
@@ -312,10 +312,10 @@ static void srvc_eng_c_cmpl_cback(uint16_t conn_id, tGATTC_OPTYPE op,
* Returns void
*
******************************************************************************/
-static void srvc_eng_connect_cback(UNUSED_ATTR tGATT_IF gatt_if,
+static void srvc_eng_connect_cback(tGATT_IF /* gatt_if */,
const RawAddress& bda, uint16_t conn_id,
bool connected, tGATT_DISCONN_REASON reason,
- UNUSED_ATTR tBT_TRANSPORT transport) {
+ tBT_TRANSPORT /* transport */) {
log::verbose("from {} connected:{} conn_id={}", bda, connected, conn_id);
if (connected) {
diff --git a/system/stack/test/stack_avdtp_test.cc b/system/stack/test/stack_avdtp_test.cc
index 0b3c1dc693..a6ec0e063d 100644
--- a/system/stack/test/stack_avdtp_test.cc
+++ b/system/stack/test/stack_avdtp_test.cc
@@ -28,10 +28,6 @@
#include "test/common/mock_functions.h"
#include "types/raw_address.h"
-#ifndef UNUSED_ATTR
-#define UNUSED_ATTR
-#endif
-
class StackAvdtpTest : public ::testing::Test {
protected:
StackAvdtpTest() = default;