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

Commit 2205741d authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge "SDP: use language-specific idioms to clean control blocks" into main

parents 00b84c6f f7b084b0
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -25,11 +25,9 @@
#define LOG_TAG "sdp"

#include <bluetooth/log.h>
#include <string.h>  // memset

#include "common/init_flags.h"
#include "internal_include/bt_target.h"
#include "os/logging/log_adapter.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_psm_types.h"
@@ -72,7 +70,7 @@ static void sdp_on_l2cap_error(uint16_t l2cap_cid, uint16_t result);
 ******************************************************************************/
void sdp_init(void) {
  /* Clears all structures and local SDP database (if Server is enabled) */
  memset(&sdp_cb, 0, sizeof(tSDP_CB));
  sdp_cb = {};

  for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) {
    sdp_cb.ccb[i].sdp_conn_timer = alarm_new("sdp.sdp_conn_timer");
+1 −1
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ tCONN_CB* sdpu_allocate_ccb(void) {
  for (xx = 0, p_ccb = sdp_cb.ccb; xx < SDP_MAX_CONNECTIONS; xx++, p_ccb++) {
    if (p_ccb->con_state == SDP_STATE_IDLE) {
      alarm_t* alarm = p_ccb->sdp_conn_timer;
      memset(p_ccb, 0, sizeof(tCONN_CB));
      *p_ccb = {};
      p_ccb->sdp_conn_timer = alarm;
      return (p_ccb);
    }