From 4f72bc0ff3633d329da49c1f47b2199c5e7cb9e4 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Wed, 23 Sep 2020 19:17:21 -0700 Subject: [PATCH] BNEP_MIN_MTU_SIZE is the same as BNEP_MTU_SIZE Just use one const. Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: Ib7239f21ea4f3270268d0c206b695150097cff7f --- internal_include/bt_target.h | 7 +------ stack/bnep/bnep_main.cc | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal_include/bt_target.h b/internal_include/bt_target.h index 4da7f2dc1..bf04fbdab 100644 --- a/internal_include/bt_target.h +++ b/internal_include/bt_target.h @@ -892,14 +892,9 @@ #define BNEP_MAX_MULTI_FILTERS 5 #endif -/* Minimum MTU size. */ -#ifndef BNEP_MIN_MTU_SIZE -#define BNEP_MIN_MTU_SIZE L2CAP_MTU_SIZE -#endif - /* Preferred MTU size. */ #ifndef BNEP_MTU_SIZE -#define BNEP_MTU_SIZE BNEP_MIN_MTU_SIZE +#define BNEP_MTU_SIZE L2CAP_MTU_SIZE #endif /* Maximum number of buffers allowed in transmit data queue. */ diff --git a/stack/bnep/bnep_main.cc b/stack/bnep/bnep_main.cc index 28118b4c5..8093794a1 100644 --- a/stack/bnep/bnep_main.cc +++ b/stack/bnep/bnep_main.cc @@ -220,11 +220,11 @@ static void bnep_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) { BNEP_TRACE_EVENT("BNEP - Rcvd cfg ind, CID: 0x%x", l2cap_cid); /* Remember the remote MTU size */ - if ((!p_cfg->mtu_present) || (p_cfg->mtu < BNEP_MIN_MTU_SIZE)) { + if ((!p_cfg->mtu_present) || (p_cfg->mtu < BNEP_MTU_SIZE)) { mtu = p_cfg->mtu; p_cfg->flush_to_present = false; p_cfg->mtu_present = true; - p_cfg->mtu = BNEP_MIN_MTU_SIZE; + p_cfg->mtu = BNEP_MTU_SIZE; p_cfg->result = result = L2CAP_CFG_UNACCEPTABLE_PARAMS; } else { if (p_cfg->mtu > BNEP_MTU_SIZE) -- 2.11.0