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

Commit 72d93459 authored by Kyunglyul Hyun's avatar Kyunglyul Hyun Committed by Automerger Merge Worker
Browse files

Merge "Remove usage of memset" into main am: ace46e41

parents c04be027 ace46e41
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ bool bta_gattc_mark_bg_conn(tGATT_IF client_if, const RawAddress& remote_bda_ptr
        }
        /* no BG connection for this device, make it available */
        if (p_bg_tck->cif_mask == 0) {
          memset(p_bg_tck, 0, sizeof(tBTA_GATTC_BG_TCK));
          *p_bg_tck = tBTA_GATTC_BG_TCK{};
        }
      }
      return true;
@@ -661,8 +661,7 @@ bool bta_gattc_mark_bg_conn(tGATT_IF client_if, const RawAddress& remote_bda_ptr
  if (!add) {
    log::error("unable to find the bg connection mask for bd_addr={}", remote_bda_ptr);
    return false;
  } else /* adding a new device mask */
  {
  } else { /* adding a new device mask */
    for (i = 0, p_bg_tck = &bta_gattc_cb.bg_track[0]; i < ble_acceptlist_size(); i++, p_bg_tck++) {
      if (!p_bg_tck->in_use) {
        p_bg_tck->in_use = true;
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <algorithm>
#include <deque>
#include <memory>

#include "os/logging/log_adapter.h"
#include "stack/gatt/gatt_int.h"
@@ -84,7 +85,7 @@ public:
  void EattChannelSetState(EattChannelState state) {
    if (state_ == EattChannelState::EATT_CHANNEL_PENDING) {
      if (state == EattChannelState::EATT_CHANNEL_OPENED) {
        memset(&server_outstanding_cmd_, 0, sizeof(tGATT_SR_CMD));
        server_outstanding_cmd_ = tGATT_SR_CMD{};
        char name[64];
        sprintf(name, "eatt_ind_ack_timer_%s_cid_0x%04x", ADDRESS_TO_LOGGABLE_CSTR(bda_), cid_);
        ind_ack_timer_ = alarm_new(name);
+6 −11
Original line number Diff line number Diff line
@@ -27,14 +27,15 @@
#include <string.h>

#include <algorithm>
#include <memory>

#include "gatt_int.h"
#include "hardware/bt_gatt_types.h"
#include "internal_include/bt_target.h"
#include "l2c_api.h"
#include "osi/include/allocator.h"
#include "stack/arbiter/acl_arbiter.h"
#include "stack/eatt/eatt.h"
#include "stack/gatt/gatt_int.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_client_interface.h"
@@ -78,8 +79,7 @@ uint32_t gatt_sr_enqueue_cmd(tGATT_TCB& tcb, uint16_t cid, uint8_t op_code, uint

  p_cmd->cid = cid;

  if ((p_cmd->op_code == 0) || (op_code == GATT_HANDLE_VALUE_CONF)) /* no pending request */
  {
  if ((p_cmd->op_code == 0) || (op_code == GATT_HANDLE_VALUE_CONF)) { /* no pending request */
    if (op_code == GATT_CMD_WRITE || op_code == GATT_SIGN_CMD_WRITE || op_code == GATT_REQ_MTU ||
        op_code == GATT_HANDLE_VALUE_CONF) {
      trans_id = ++tcb.trans_id;
@@ -154,7 +154,7 @@ void gatt_dequeue_sr_cmd(tGATT_TCB& tcb, uint16_t cid) {
    osi_free(fixed_queue_try_dequeue(p_cmd->multi_rsp_q));
  }
  fixed_queue_free(p_cmd->multi_rsp_q, NULL);
  memset(p_cmd, 0, sizeof(tGATT_SR_CMD));
  *p_cmd = tGATT_SR_CMD{};
}

static void build_read_multi_rsp(tGATT_SR_CMD* p_cmd, uint16_t mtu) {
@@ -241,7 +241,6 @@ static void build_read_multi_rsp(tGATT_SR_CMD* p_cmd, uint16_t mtu) {
      p_cmd->status = GATT_NOT_FOUND;
      break;
    }

  } /* loop through all handles*/

  /* Sanity check on the buffer length */
@@ -289,8 +288,7 @@ static bool process_read_multi_rsp(tGATT_SR_CMD* p_cmd, tGATT_STATUS status, tGA
      build_read_multi_rsp(p_cmd, mtu);
      return true;
    }
  } else /* any handle read exception occurs, return error */
  {
  } else { /* any handle read exception occurs, return error */
    return true;
  }

@@ -425,8 +423,7 @@ void gatt_process_exec_write_req(tGATT_TCB& tcb, uint16_t cid, uint8_t op_code,
        }
      }
    }
  } else /* nothing needs to be executed , send response now */
  {
  } else { /* nothing needs to be executed , send response now */
    log::error("gatt_process_exec_write_req: no prepare write pending");
    gatt_send_error_rsp(tcb, cid, GATT_ERROR, GATT_REQ_EXEC_WRITE, 0, false);
  }
@@ -1338,7 +1335,6 @@ static bool gatts_process_db_out_of_sync(tGATT_TCB& tcb, uint16_t cid, uint8_t o
          (uuid == Uuid::From16Bit(GATT_UUID_DATABASE_HASH))) {
        should_ignore = false;
      }

    } break;
    case GATT_REQ_READ: {
      // Check if read database hash by handle
@@ -1356,7 +1352,6 @@ static bool gatts_process_db_out_of_sync(tGATT_TCB& tcb, uint16_t cid, uint8_t o
      if (status == GATT_SUCCESS && handle == gatt_cb.handle_of_database_hash) {
        should_ignore = false;
      }

    } break;
    case GATT_REQ_READ_BY_GRP_TYPE: /* discover primary services */
    case GATT_REQ_FIND_TYPE_VALUE:  /* discover service by UUID */