From 25984b0d221cf48cd4dd606b881674ce7b29bf44 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Fri, 24 Jun 2016 14:05:58 -0700 Subject: [PATCH] Get rid of unused BTA_DYNAMIC_MEMORY Change-Id: Idc7fcddfecac9ab7d9800b496e2380ae277f357f --- bta/ag/bta_ag_int.h | 5 --- bta/ag/bta_ag_main.c | 2 -- bta/ar/bta_ar.c | 2 -- bta/ar/bta_ar_int.h | 5 --- bta/av/bta_av_int.h | 5 --- bta/av/bta_av_main.c | 2 -- bta/dm/bta_dm_int.h | 15 --------- bta/dm/bta_dm_main.cc | 2 -- bta/gatt/bta_gattc_int.h | 5 --- bta/gatt/bta_gattc_main.cc | 2 -- bta/gatt/bta_gatts_int.h | 5 --- bta/gatt/bta_gatts_main.cc | 2 -- bta/hh/bta_hh_int.h | 5 --- bta/hh/bta_hh_main.cc | 3 +- bta/hl/bta_hl_int.h | 5 --- bta/hl/bta_hl_main.c | 3 -- bta/jv/bta_jv_int.h | 5 --- bta/jv/bta_jv_main.c | 2 -- bta/mce/bta_mce_int.h | 5 --- bta/mce/bta_mce_main.c | 2 -- bta/pan/bta_pan_int.h | 6 ---- bta/pan/bta_pan_main.c | 2 -- bta/sdp/bta_sdp.c | 2 -- bta/sdp/bta_sdp_int.h | 5 --- bta/sys/bta_sys_int.h | 5 --- bta/sys/bta_sys_main.c | 2 -- main/bte_init.c | 84 ---------------------------------------------- stack/include/dyn_mem.h | 8 ----- 28 files changed, 1 insertion(+), 195 deletions(-) diff --git a/bta/ag/bta_ag_int.h b/bta/ag/bta_ag_int.h index acde78f54..bfa2daecc 100644 --- a/bta/ag/bta_ag_int.h +++ b/bta/ag/bta_ag_int.h @@ -333,12 +333,7 @@ extern const uint8_t bta_ag_sec_id[BTA_AG_NUM_IDX]; extern const tBTA_AG_AT_CMD *bta_ag_at_tbl[BTA_AG_NUM_IDX]; /* control block declaration */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_AG_CB bta_ag_cb; -#else -extern tBTA_AG_CB *bta_ag_cb_ptr; -#define bta_ag_cb (*bta_ag_cb_ptr) -#endif /* config struct */ extern tBTA_AG_CFG *p_bta_ag_cfg; diff --git a/bta/ag/bta_ag_main.c b/bta/ag/bta_ag_main.c index 293163b30..7b9a0e342 100644 --- a/bta/ag/bta_ag_main.c +++ b/bta/ag/bta_ag_main.c @@ -270,9 +270,7 @@ const tBTA_AG_ST_TBL bta_ag_st_tbl[] = *****************************************************************************/ /* AG control block */ -#if BTA_DYNAMIC_MEMORY == FALSE tBTA_AG_CB bta_ag_cb; -#endif /******************************************************************************* ** diff --git a/bta/ar/bta_ar.c b/bta/ar/bta_ar.c index 2464620bd..dd0abf492 100644 --- a/bta/ar/bta_ar.c +++ b/bta/ar/bta_ar.c @@ -28,9 +28,7 @@ /* AV control block */ -#if BTA_DYNAMIC_MEMORY == FALSE tBTA_AR_CB bta_ar_cb; -#endif /******************************************************************************* ** diff --git a/bta/ar/bta_ar_int.h b/bta/ar/bta_ar_int.h index 2c142fcd3..a14b6154d 100644 --- a/bta/ar/bta_ar_int.h +++ b/bta/ar/bta_ar_int.h @@ -54,11 +54,6 @@ typedef struct *****************************************************************************/ /* control block declaration */ -#if BTA_DYNAMIC_MEMORY == FALSE extern tBTA_AR_CB bta_ar_cb; -#else -extern tBTA_AR_CB *bta_ar_cb_ptr; -#define bta_ar_cb (*bta_ar_cb_ptr) -#endif #endif /* BTA_AR_INT_H */ diff --git a/bta/av/bta_av_int.h b/bta/av/bta_av_int.h index de7a59c7d..2f729ee94 100644 --- a/bta/av/bta_av_int.h +++ b/bta/av/bta_av_int.h @@ -610,12 +610,7 @@ typedef struct *****************************************************************************/ /* control block declaration */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_AV_CB bta_av_cb; -#else -extern tBTA_AV_CB *bta_av_cb_ptr; -#define bta_av_cb (*bta_av_cb_ptr) -#endif /* config struct */ extern tBTA_AV_CFG *p_bta_av_cfg; diff --git a/bta/av/bta_av_main.c b/bta/av/bta_av_main.c index 556d97cb0..8c7a77131 100644 --- a/bta/av/bta_av_main.c +++ b/bta/av/bta_av_main.c @@ -199,9 +199,7 @@ const tBTA_AV_NSM_ACT bta_av_nsm_act[] = *****************************************************************************/ /* AV control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_AV_CB bta_av_cb; -#endif #if (BTA_AV_DEBUG == TRUE) static char *bta_av_st_code(uint8_t state); diff --git a/bta/dm/bta_dm_int.h b/bta/dm/bta_dm_int.h index 4268a1f6c..ab1f53236 100644 --- a/bta/dm/bta_dm_int.h +++ b/bta/dm/bta_dm_int.h @@ -1048,28 +1048,13 @@ extern const tBTA_DM_EIR_CONF bta_dm_eir_cfg; extern tBTA_DM_EIR_CONF *p_bta_dm_eir_cfg; /* DM control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_DM_CB bta_dm_cb; -#else -extern tBTA_DM_CB *bta_dm_cb_ptr; -#define bta_dm_cb (*bta_dm_cb_ptr) -#endif /* DM search control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_DM_SEARCH_CB bta_dm_search_cb; -#else -extern tBTA_DM_SEARCH_CB *bta_dm_search_cb_ptr; -#define bta_dm_search_cb (*bta_dm_search_cb_ptr) -#endif /* DI control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_DM_DI_CB bta_dm_di_cb; -#else -extern tBTA_DM_DI_CB *bta_dm_di_cb_ptr; -#define bta_dm_di_cb (*bta_dm_di_cb_ptr) -#endif extern bool bta_dm_sm_execute(BT_HDR *p_msg); extern void bta_dm_sm_disable( void ); diff --git a/bta/dm/bta_dm_main.cc b/bta/dm/bta_dm_main.cc index 50c622cd9..6dcb04039 100644 --- a/bta/dm/bta_dm_main.cc +++ b/bta/dm/bta_dm_main.cc @@ -31,11 +31,9 @@ ** Constants and types *****************************************************************************/ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_DM_CB bta_dm_cb; tBTA_DM_SEARCH_CB bta_dm_search_cb; tBTA_DM_DI_CB bta_dm_di_cb; -#endif #define BTA_DM_NUM_ACTIONS (BTA_DM_MAX_EVT & 0x00ff) diff --git a/bta/gatt/bta_gattc_int.h b/bta/gatt/bta_gattc_int.h index 44b0d3a29..f7bafe85d 100644 --- a/bta/gatt/bta_gattc_int.h +++ b/bta/gatt/bta_gattc_int.h @@ -392,12 +392,7 @@ typedef struct *****************************************************************************/ /* GATTC control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_GATTC_CB bta_gattc_cb; -#else -extern tBTA_GATTC_CB *bta_gattc_cb_ptr; -#define bta_gattc_cb (*bta_gattc_cb_ptr) -#endif /***************************************************************************** ** Function prototypes diff --git a/bta/gatt/bta_gattc_main.cc b/bta/gatt/bta_gattc_main.cc index d676b2410..239c25a1b 100644 --- a/bta/gatt/bta_gattc_main.cc +++ b/bta/gatt/bta_gattc_main.cc @@ -243,9 +243,7 @@ const tBTA_GATTC_ST_TBL bta_gattc_st_tbl[] = *****************************************************************************/ /* GATTC control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_GATTC_CB bta_gattc_cb; -#endif #if (BTA_GATT_DEBUG == TRUE) static char *gattc_evt_code(tBTA_GATTC_INT_EVT evt_code); diff --git a/bta/gatt/bta_gatts_int.h b/bta/gatt/bta_gatts_int.h index 8784e2e8f..69bda1f6b 100644 --- a/bta/gatt/bta_gatts_int.h +++ b/bta/gatt/bta_gatts_int.h @@ -214,12 +214,7 @@ typedef struct *****************************************************************************/ /* GATTC control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_GATTS_CB bta_gatts_cb; -#else -extern tBTA_GATTS_CB *bta_gatts_cb_ptr; - #define bta_gatts_cb (*bta_gatts_cb_ptr) -#endif /***************************************************************************** ** Function prototypes diff --git a/bta/gatt/bta_gatts_main.cc b/bta/gatt/bta_gatts_main.cc index 8a83907dc..5656ecc4a 100644 --- a/bta/gatt/bta_gatts_main.cc +++ b/bta/gatt/bta_gatts_main.cc @@ -46,9 +46,7 @@ const tBTA_GATTS_SRVC_ACT bta_gatts_srvc_build_act[] = }; /* GATTS control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_GATTS_CB bta_gatts_cb; -#endif /******************************************************************************* ** diff --git a/bta/hh/bta_hh_int.h b/bta/hh/bta_hh_int.h index 064b1864f..da26472eb 100644 --- a/bta/hh/bta_hh_int.h +++ b/bta/hh/bta_hh_int.h @@ -316,12 +316,7 @@ typedef struct } tBTA_HH_CB; -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_HH_CB bta_hh_cb; -#else -extern tBTA_HH_CB *bta_hh_cb_ptr; -#define bta_hh_cb (*bta_hh_cb_ptr) -#endif /* from bta_hh_cfg.c */ extern tBTA_HH_CFG *p_bta_hh_cfg; diff --git a/bta/hh/bta_hh_main.cc b/bta/hh/bta_hh_main.cc index 1d565e03a..50ae8b192 100644 --- a/bta/hh/bta_hh_main.cc +++ b/bta/hh/bta_hh_main.cc @@ -245,9 +245,8 @@ const tBTA_HH_ST_TBL bta_hh_st_tbl[] = /***************************************************************************** ** Global data *****************************************************************************/ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_HH_CB bta_hh_cb; -#endif + /***************************************************************************** ** Static functions *****************************************************************************/ diff --git a/bta/hl/bta_hl_int.h b/bta/hl/bta_hl_int.h index 0a83d6f05..33a41555e 100644 --- a/bta/hl/bta_hl_int.h +++ b/bta/hl/bta_hl_int.h @@ -578,12 +578,7 @@ typedef struct *****************************************************************************/ /* HL control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_HL_CB bta_hl_cb; -#else -extern tBTA_HL_CB *bta_hl_cb_ptr; - #define bta_hl_cb (*bta_hl_cb_ptr) -#endif #define BTA_HL_GET_CB_PTR() &(bta_hl_cb) #define BTA_HL_GET_APP_CB_PTR(app_idx) &(bta_hl_cb.acb[(app_idx)]) diff --git a/bta/hl/bta_hl_main.c b/bta/hl/bta_hl_main.c index 4b3e8abf3..c91ccfad2 100644 --- a/bta/hl/bta_hl_main.c +++ b/bta/hl/bta_hl_main.c @@ -400,10 +400,7 @@ const tBTA_HL_CCH_ST_TBL bta_hl_cch_st_tbl[] = *****************************************************************************/ /* HL control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_HL_CB bta_hl_cb; -#endif - /******************************************************************************* ** diff --git a/bta/jv/bta_jv_int.h b/bta/jv/bta_jv_int.h index 4e91fc50a..92e4eb9d1 100644 --- a/bta/jv/bta_jv_int.h +++ b/bta/jv/bta_jv_int.h @@ -397,12 +397,7 @@ enum }; /* JV control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_JV_CB bta_jv_cb; -#else -extern tBTA_JV_CB *bta_jv_cb_ptr; -#define bta_jv_cb (*bta_jv_cb_ptr) -#endif /* config struct */ extern tBTA_JV_CFG *p_bta_jv_cfg; diff --git a/bta/jv/bta_jv_main.c b/bta/jv/bta_jv_main.c index d474a53db..5162f3e11 100644 --- a/bta/jv/bta_jv_main.c +++ b/bta/jv/bta_jv_main.c @@ -31,9 +31,7 @@ ** Constants and types *****************************************************************************/ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_JV_CB bta_jv_cb; -#endif /* state machine action enumeration list */ #define BTA_JV_NUM_ACTIONS (BTA_JV_MAX_INT_EVT & 0x00ff) diff --git a/bta/mce/bta_mce_int.h b/bta/mce/bta_mce_int.h index 925906e3f..d27575d42 100644 --- a/bta/mce/bta_mce_int.h +++ b/bta/mce/bta_mce_int.h @@ -79,12 +79,7 @@ enum }; /* MCE control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_MCE_CB bta_mce_cb; -#else -extern tBTA_MCE_CB *bta_mce_cb_ptr; -#define bta_mce_cb (*bta_mce_cb_ptr) -#endif /* config struct */ extern tBTA_MCE_CFG *p_bta_mce_cfg; diff --git a/bta/mce/bta_mce_main.c b/bta/mce/bta_mce_main.c index 632ee6838..e418aa0a4 100644 --- a/bta/mce/bta_mce_main.c +++ b/bta/mce/bta_mce_main.c @@ -33,9 +33,7 @@ ** Constants and types *****************************************************************************/ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_MCE_CB bta_mce_cb; -#endif /* state machine action enumeration list */ #define BTA_MCE_NUM_ACTIONS (BTA_MCE_MAX_INT_EVT & 0x00ff) diff --git a/bta/pan/bta_pan_int.h b/bta/pan/bta_pan_int.h index cc619bcca..472e9e051 100644 --- a/bta/pan/bta_pan_int.h +++ b/bta/pan/bta_pan_int.h @@ -184,13 +184,7 @@ typedef struct *****************************************************************************/ /* PAN control block */ - -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_PAN_CB bta_pan_cb; -#else -extern tBTA_PAN_CB *bta_pan_cb_ptr; -#define bta_pan_cb (*bta_pan_cb_ptr) -#endif /***************************************************************************** ** Function prototypes diff --git a/bta/pan/bta_pan_main.c b/bta/pan/bta_pan_main.c index 2d35c4284..c26290628 100644 --- a/bta/pan/bta_pan_main.c +++ b/bta/pan/bta_pan_main.c @@ -147,9 +147,7 @@ const tBTA_PAN_ST_TBL bta_pan_st_tbl[] = { *****************************************************************************/ /* PAN control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_PAN_CB bta_pan_cb; -#endif /******************************************************************************* ** diff --git a/bta/sdp/bta_sdp.c b/bta/sdp/bta_sdp.c index 613159ae2..6654c408a 100644 --- a/bta/sdp/bta_sdp.c +++ b/bta/sdp/bta_sdp.c @@ -33,9 +33,7 @@ ** Constants and types *****************************************************************************/ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_SDP_CB bta_sdp_cb; -#endif /* state machine action enumeration list */ #define BTA_SDP_NUM_ACTIONS (BTA_SDP_MAX_INT_EVT & 0x00ff) diff --git a/bta/sdp/bta_sdp_int.h b/bta/sdp/bta_sdp_int.h index 536e8e608..932adf580 100644 --- a/bta/sdp/bta_sdp_int.h +++ b/bta/sdp/bta_sdp_int.h @@ -95,12 +95,7 @@ typedef struct /* SDP control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_SDP_CB bta_sdp_cb; -#else -extern tBTA_SDP_CB *bta_sdp_cb_ptr; -#define bta_sdp_cb (*bta_sdp_cb_ptr) -#endif /* config struct */ extern tBTA_SDP_CFG *p_bta_sdp_cfg; diff --git a/bta/sys/bta_sys_int.h b/bta/sys/bta_sys_int.h index b81886ec7..3ac73f3fe 100644 --- a/bta/sys/bta_sys_int.h +++ b/bta/sys/bta_sys_int.h @@ -83,12 +83,7 @@ typedef struct *****************************************************************************/ /* system manager control block */ -#if (BTA_DYNAMIC_MEMORY == FALSE) extern tBTA_SYS_CB bta_sys_cb; -#else -extern tBTA_SYS_CB *bta_sys_cb_ptr; -#define bta_sys_cb (*bta_sys_cb_ptr) -#endif /* functions used for BTA SYS HW state machine */ void bta_sys_hw_btm_cback( tBTM_DEV_STATUS status ); diff --git a/bta/sys/bta_sys_main.c b/bta/sys/bta_sys_main.c index 193851981..5f56b8c9d 100644 --- a/bta/sys/bta_sys_main.c +++ b/bta/sys/bta_sys_main.c @@ -45,9 +45,7 @@ #endif /* system manager control block definition */ -#if (BTA_DYNAMIC_MEMORY == FALSE) tBTA_SYS_CB bta_sys_cb; -#endif fixed_queue_t *btu_bta_alarm_queue; extern thread_t *bt_workqueue_thread; diff --git a/main/bte_init.c b/main/bte_init.c index e212f3900..a0b8418b6 100644 --- a/main/bte_init.c +++ b/main/bte_init.c @@ -64,55 +64,6 @@ #endif #endif -/***** BTA Modules ******/ -#if BTA_INCLUDED == TRUE && BTA_DYNAMIC_MEMORY == TRUE -#include "bta_api.h" -#include "bta_sys.h" - -#include "bta_ag_int.h" - -#if BTA_HS_INCLUDED == TRUE -#include "bta_hs_int.h" -#endif - -#include "bta_dm_int.h" - -#if BTA_AR_INCLUDED==TRUE -#include "bta_ar_int.h" -#endif -#if BTA_AV_INCLUDED==TRUE -#include "bta_av_int.h" -#endif - -#if BTA_HH_INCLUDED==TRUE -#include "bta_hh_int.h" -#endif - -#if BTA_JV_INCLUDED==TRUE -#include "bta_jv_int.h" -tBTA_JV_CB *bta_jv_cb_ptr = NULL; -#endif - -#if BTA_HL_INCLUDED == TRUE -#include "bta_hl_int.h" -#endif - -#if BTA_GATT_INCLUDED == TRUE -#include "bta_gattc_int.h" -#include "bta_gatts_int.h" -#endif - -#if BTA_PAN_INCLUDED==TRUE -#include "bta_pan_int.h" -#endif - -#include "bta_sys_int.h" - -/* control block for patch ram downloading */ -#include "bta_prm_int.h" - -#endif /* BTA_INCLUDED */ - /***************************************************************************** ** F U N C T I O N S * ******************************************************************************/ @@ -173,39 +124,4 @@ void BTE_InitStack(void) MCA_Init(); #endif -/**************** -** BTA Modules ** -*****************/ -#if (BTA_INCLUDED == TRUE && BTA_DYNAMIC_MEMORY == TRUE) - memset((void*)bta_sys_cb_ptr, 0, sizeof(tBTA_SYS_CB)); - memset((void*)bta_dm_cb_ptr, 0, sizeof(tBTA_DM_CB)); - memset((void*)bta_dm_search_cb_ptr, 0, sizeof(tBTA_DM_SEARCH_CB)); - memset((void*)bta_dm_di_cb_ptr, 0, sizeof(tBTA_DM_DI_CB)); - memset((void*)bta_prm_cb_ptr, 0, sizeof(tBTA_PRM_CB)); - memset((void*)bta_ag_cb_ptr, 0, sizeof(tBTA_AG_CB)); -#if BTA_HS_INCLUDED == TRUE - memset((void*)bta_hs_cb_ptr, 0, sizeof(tBTA_HS_CB)); -#endif -#if BTA_AR_INCLUDED==TRUE - memset((void *)bta_ar_cb_ptr, 0, sizeof(tBTA_AR_CB)); -#endif -#if BTA_AV_INCLUDED==TRUE - memset((void *)bta_av_cb_ptr, 0, sizeof(tBTA_AV_CB)); -#endif -#if BTA_HH_INCLUDED==TRUE - memset((void *)bta_hh_cb_ptr, 0, sizeof(tBTA_HH_CB)); -#endif -#if BTA_HL_INCLUDED==TRUE - memset((void *)bta_hl_cb_ptr, 0, sizeof(tBTA_HL_CB)); -#endif -#if BTA_GATT_INCLUDED==TRUE - memset((void *)bta_gattc_cb_ptr, 0, sizeof(tBTA_GATTC_CB)); - memset((void *)bta_gatts_cb_ptr, 0, sizeof(tBTA_GATTS_CB)); -#endif -#if BTA_PAN_INCLUDED==TRUE - memset((void *)bta_pan_cb_ptr, 0, sizeof(tBTA_PAN_CB)); -#endif - -#endif /* BTA_INCLUDED == TRUE */ - } diff --git a/stack/include/dyn_mem.h b/stack/include/dyn_mem.h index de599ed05..2f1119be6 100644 --- a/stack/include/dyn_mem.h +++ b/stack/include/dyn_mem.h @@ -138,13 +138,5 @@ #define LLCP_DYNAMIC_MEMORY FALSE #endif -/**************************************************************************** -** Define memory usage for BTA (if not defined in bdroid_buildcfg.h) -** The default for each component is to use static memory allocations. -*/ -#ifndef BTA_DYNAMIC_MEMORY -#define BTA_DYNAMIC_MEMORY FALSE -#endif - #endif /* #ifdef DYN_MEM_H */ -- 2.11.0