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

Commit d9e3cc8c authored by Myles Watson's avatar Myles Watson
Browse files

system/btif: 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: I38d9fd922ba30ccdbc7e48f708922fb0f9ddd29e
parent b5d4905c
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -42,7 +42,6 @@
#include "include/hardware/bt_av.h"
#include "include/hardware/bt_av.h"
#include "internal_include/bt_trace.h"
#include "internal_include/bt_trace.h"
#include "osi/include/allocator.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "stack/include/a2dp_codec_api.h"
#include "stack/include/a2dp_codec_api.h"
#include "stack/include/a2dp_error_codes.h"
#include "stack/include/a2dp_error_codes.h"
#include "stack/include/a2dp_ext.h"
#include "stack/include/a2dp_ext.h"
@@ -450,9 +449,9 @@ tA2DP_STATUS BtaAvCo::ProcessSinkGetConfig(tBTA_AV_HNDL bta_av_handle,
}
}


void BtaAvCo::ProcessSetConfig(tBTA_AV_HNDL bta_av_handle,
void BtaAvCo::ProcessSetConfig(tBTA_AV_HNDL bta_av_handle,
                               UNUSED_ATTR const RawAddress& peer_address,
                               const RawAddress& peer_address,
                               const uint8_t* p_codec_info,
                               const uint8_t* p_codec_info, uint8_t seid,
                               UNUSED_ATTR uint8_t seid, uint8_t num_protect,
                               uint8_t num_protect,
                               const uint8_t* p_protect_info,
                               const uint8_t* p_protect_info,
                               uint8_t t_local_sep, uint8_t avdt_handle) {
                               uint8_t t_local_sep, uint8_t avdt_handle) {
  tA2DP_STATUS status = A2DP_SUCCESS;
  tA2DP_STATUS status = A2DP_SUCCESS;
+5 −5
Original line number Original line Diff line number Diff line
@@ -537,8 +537,8 @@ void bta_hh_co_close(btif_hh_device_t* p_dev) {
 ******************************************************************************/
 ******************************************************************************/
void bta_hh_co_data(uint8_t dev_handle, uint8_t* p_rpt, uint16_t len,
void bta_hh_co_data(uint8_t dev_handle, uint8_t* p_rpt, uint16_t len,
                    tBTA_HH_PROTO_MODE mode, uint8_t sub_class,
                    tBTA_HH_PROTO_MODE mode, uint8_t sub_class,
                    uint8_t ctry_code,
                    uint8_t ctry_code, const tAclLinkSpec& /* link_spec */,
                    UNUSED_ATTR const tAclLinkSpec& link_spec, uint8_t app_id) {
                    uint8_t app_id) {
  btif_hh_device_t* p_dev;
  btif_hh_device_t* p_dev;


  log::verbose(
  log::verbose(
@@ -773,7 +773,7 @@ void bta_hh_co_get_rpt_rsp(uint8_t dev_handle, uint8_t status,
 ******************************************************************************/
 ******************************************************************************/
void bta_hh_le_co_rpt_info(const tAclLinkSpec& link_spec,
void bta_hh_le_co_rpt_info(const tAclLinkSpec& link_spec,
                           tBTA_HH_RPT_CACHE_ENTRY* p_entry,
                           tBTA_HH_RPT_CACHE_ENTRY* p_entry,
                           UNUSED_ATTR uint8_t app_id) {
                           uint8_t /* app_id */) {
  unsigned idx = 0;
  unsigned idx = 0;


  std::string addrstr = link_spec.addrt.bda.ToString();
  std::string addrstr = link_spec.addrt.bda.ToString();
@@ -815,7 +815,7 @@ void bta_hh_le_co_rpt_info(const tAclLinkSpec& link_spec,
 ******************************************************************************/
 ******************************************************************************/
tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(const tAclLinkSpec& link_spec,
tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(const tAclLinkSpec& link_spec,
                                                 uint8_t* p_num_rpt,
                                                 uint8_t* p_num_rpt,
                                                 UNUSED_ATTR uint8_t app_id) {
                                                 uint8_t app_id) {
  std::string addrstr = link_spec.addrt.bda.ToString();
  std::string addrstr = link_spec.addrt.bda.ToString();
  const char* bdstr = addrstr.c_str();
  const char* bdstr = addrstr.c_str();


@@ -854,7 +854,7 @@ tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(const tAclLinkSpec& link_spec,
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void bta_hh_le_co_reset_rpt_cache(const tAclLinkSpec& link_spec,
void bta_hh_le_co_reset_rpt_cache(const tAclLinkSpec& link_spec,
                                  UNUSED_ATTR uint8_t app_id) {
                                  uint8_t /* app_id */) {
  std::string addrstr = link_spec.addrt.bda.ToString();
  std::string addrstr = link_spec.addrt.bda.ToString();
  const char* bdstr = addrstr.c_str();
  const char* bdstr = addrstr.c_str();


+8 −15
Original line number Original line Diff line number Diff line
@@ -38,7 +38,6 @@
#include "btif_util.h"
#include "btif_util.h"
#include "os/log.h"
#include "os/log.h"
#include "osi/include/allocator.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"
#include "pan_api.h"
#include "pan_api.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_hdr.h"
#include "types/raw_address.h"
#include "types/raw_address.h"
@@ -164,8 +163,7 @@ void bta_pan_co_tx_path(uint16_t handle, uint8_t app_id) {
 * Returns          void
 * Returns          void
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void bta_pan_co_rx_path(UNUSED_ATTR uint16_t handle,
void bta_pan_co_rx_path(uint16_t /* handle */, uint8_t /* app_id */) {
                        UNUSED_ATTR uint8_t app_id) {
  log::verbose("bta_pan_co_rx_path not used");
  log::verbose("bta_pan_co_rx_path not used");
}
}


@@ -183,8 +181,7 @@ void bta_pan_co_rx_path(UNUSED_ATTR uint16_t handle,
 * Returns          void
 * Returns          void
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void bta_pan_co_rx_flow(UNUSED_ATTR uint16_t handle, UNUSED_ATTR uint8_t app_id,
void bta_pan_co_rx_flow(uint16_t handle, uint8_t /* app_id */, bool enable) {
                        UNUSED_ATTR bool enable) {
  log::verbose("bta_pan_co_rx_flow, enabled:{}, not used", enable);
  log::verbose("bta_pan_co_rx_flow, enabled:{}, not used", enable);
  btpan_conn_t* conn = btpan_find_conn_handle(handle);
  btpan_conn_t* conn = btpan_find_conn_handle(handle);
  if (!conn || conn->state != PAN_STATE_OPEN) return;
  if (!conn || conn->state != PAN_STATE_OPEN) return;
@@ -200,11 +197,9 @@ void bta_pan_co_rx_flow(UNUSED_ATTR uint16_t handle, UNUSED_ATTR uint8_t app_id,
 * Returns          void
 * Returns          void
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void bta_pan_co_pfilt_ind(UNUSED_ATTR uint16_t handle,
void bta_pan_co_pfilt_ind(uint16_t /* handle */, bool /* indication */,
                          UNUSED_ATTR bool indication,
                          tBTA_PAN_STATUS /* result */, uint16_t /* len */,
                          UNUSED_ATTR tBTA_PAN_STATUS result,
                          uint8_t* /* p_filters */) {
                          UNUSED_ATTR uint16_t len,
                          UNUSED_ATTR uint8_t* p_filters) {
  log::verbose("bta_pan_co_pfilt_ind");
  log::verbose("bta_pan_co_pfilt_ind");
}
}


@@ -217,10 +212,8 @@ void bta_pan_co_pfilt_ind(UNUSED_ATTR uint16_t handle,
 * Returns          void
 * Returns          void
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void bta_pan_co_mfilt_ind(UNUSED_ATTR uint16_t handle,
void bta_pan_co_mfilt_ind(uint16_t /* handle */, bool /* indication */,
                          UNUSED_ATTR bool indication,
                          tBTA_PAN_STATUS /* result */, uint16_t /* len */,
                          UNUSED_ATTR tBTA_PAN_STATUS result,
                          uint8_t* /* p_filters */) {
                          UNUSED_ATTR uint16_t len,
                          UNUSED_ATTR uint8_t* p_filters) {
  log::verbose("bta_pan_co_mfilt_ind");
  log::verbose("bta_pan_co_mfilt_ind");
}
}
+2 −3
Original line number Original line Diff line number Diff line
@@ -626,8 +626,7 @@ static void on_cli_rfc_connect(tBTA_JV_RFCOMM_OPEN* p_open, uint32_t id) {
  }
  }
}
}


static void on_rfc_close(UNUSED_ATTR tBTA_JV_RFCOMM_CLOSE* p_close,
static void on_rfc_close(tBTA_JV_RFCOMM_CLOSE* /* p_close */, uint32_t id) {
                         uint32_t id) {
  log::verbose("id:{}", id);
  log::verbose("id:{}", id);
  std::unique_lock<std::recursive_mutex> lock(slot_lock);
  std::unique_lock<std::recursive_mutex> lock(slot_lock);


@@ -945,7 +944,7 @@ static bool flush_incoming_que_on_wr_signal(rfc_slot_t* slot) {
  return true;
  return true;
}
}


void btsock_rfc_signaled(UNUSED_ATTR int fd, int flags, uint32_t id) {
void btsock_rfc_signaled(int /* fd */, int flags, uint32_t id) {
  bool need_close = false;
  bool need_close = false;
  std::unique_lock<std::recursive_mutex> lock(slot_lock);
  std::unique_lock<std::recursive_mutex> lock(slot_lock);
  rfc_slot_t* slot = find_rfc_slot_by_id(id);
  rfc_slot_t* slot = find_rfc_slot_by_id(id);