Commit 779d5db4 authored by wujing's avatar wujing

fix cppcheck comments

parent 7a67e40e
......@@ -990,7 +990,7 @@ set(UTIL_SRC
${OPENAIR_DIR}/common/utils/LOG/log.c
# ${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
${OPENAIR2_DIR}/UTIL/MATH/oml.c
# ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
......
......@@ -35,6 +35,7 @@ int timer_expired(int fd);
task_list_t tasks[TASK_MAX];
extern "C" {
#if 0
void *pool_buffer_init (void) {
return 0;
}
......@@ -63,7 +64,7 @@ extern "C" {
ptr->size=sizeP;
return ptr;
}
#endif
void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize_t size) {
void *ptr = NULL;
AssertFatal ((ptr=malloc (size)) != NULL, "Memory allocation of %zu bytes failed (%d -> %d)!\n",
......
......@@ -713,7 +713,7 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
UL_RCC_INFO.sr_ind[index] = *ind;
LOG_D(MAC,"%s() UL_INFO[%d].sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, index, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
if (ind->sr_indication_body.number_of_srs > 0){
UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list;
UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = ind->sr_indication_body.sr_pdu_list;
}
for (int i=0; i<ind->sr_indication_body.number_of_srs; i++) {
nfapi_sr_indication_pdu_t *dest_pdu = &UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list[i];
......
......@@ -39,7 +39,7 @@ nfapi_pnf_config_t* nfapi_pnf_config_create()
_this->_public.codec_config.allocate = &malloc;
_this->_public.codec_config.deallocate = &free;
return &(_this->_public);
return (nfapi_pnf_config_t*)(_this);
}
void nfapi_pnf_config_destory(nfapi_pnf_config_t* config)
......
......@@ -44,7 +44,7 @@ nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create()
_this->_public.codec_config.allocate = &malloc;
_this->_public.codec_config.deallocate = &free;
return &(_this->_public);
return (nfapi_pnf_p7_config_t*)(_this);
}
void nfapi_pnf_p7_config_destory(nfapi_pnf_p7_config_t* config)
......
......@@ -188,7 +188,7 @@ nfapi_vnf_config_t* nfapi_vnf_config_create()
_this->_public.codec_config.deallocate = &free;
return &(_this->_public);
return (nfapi_vnf_config_t*)(_this);
}
void nfapi_vnf_config_destory(nfapi_vnf_config_t* config)
......
......@@ -85,7 +85,6 @@ void vnf_p7_free(vnf_p7_t* vnf_p7, void* ptr)
else
{
free(ptr);
ptr = 0;
}
}
......@@ -101,7 +100,6 @@ void vnf_p7_codec_free(vnf_p7_t* vnf_p7, void* ptr)
else
{
free(ptr);
ptr = 0;
}
}
......@@ -250,6 +248,7 @@ void vnf_p7_rx_reassembly_queue_remove_msg(vnf_p7_t* vnf_p7, vnf_p7_rx_reassembl
vnf_p7_free(vnf_p7, iterator->segments[i].buffer);
}
vnf_p7_free(vnf_p7, iterator);
iterator = 0;
#endif
break;
}
......@@ -302,6 +301,7 @@ void vnf_p7_rx_reassembly_queue_remove_old_msgs(vnf_p7_t* vnf_p7, vnf_p7_rx_reas
vnf_p7_free(vnf_p7, to_delete->segments[i].buffer);
}
vnf_p7_free(vnf_p7, to_delete);
to_delete = 0;
#endif
}
else
......@@ -863,6 +863,7 @@ void vnf_handle_ue_release_resp(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
vnf_p7_codec_free(vnf_p7, resp.vendor_extension);
resp.vendor_extension = 0;
}
}
......@@ -1648,11 +1649,13 @@ void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header)
case NFAPI_HARQ_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_harq_indication_t*)(header))->harq_indication_body.harq_pdu_list);
((nfapi_harq_indication_t*)(header))->harq_indication_body.harq_pdu_list = 0;
}
break;
case NFAPI_CRC_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_crc_indication_t*)(header))->crc_indication_body.crc_pdu_list);
((nfapi_crc_indication_t*)(header))->crc_indication_body.crc_pdu_list = 0;
}
break;
case NFAPI_RX_ULSCH_INDICATION:
......@@ -1665,27 +1668,33 @@ void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header)
}
vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list);
vnf_p7, rx_ind->rx_indication_body.rx_pdu_list = 0;
}
break;
case NFAPI_RACH_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_rach_indication_t*)(header))->rach_indication_body.preamble_list);
((nfapi_rach_indication_t*)(header))->rach_indication_body.preamble_list = 0;
}
break;
case NFAPI_SRS_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_srs_indication_t*)(header))->srs_indication_body.srs_pdu_list);
((nfapi_srs_indication_t*)(header))->srs_indication_body.srs_pdu_list = 0;
}
break;
case NFAPI_RX_SR_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_sr_indication_t*)(header))->sr_indication_body.sr_pdu_list);
((nfapi_sr_indication_t*)(header))->sr_indication_body.sr_pdu_list = 0;
}
break;
case NFAPI_RX_CQI_INDICATION:
{
vnf_p7_codec_free(vnf_p7, ((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_pdu_list);
((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_pdu_list = 0;
vnf_p7_codec_free(vnf_p7, ((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_raw_pdu_list);
((nfapi_cqi_indication_t*)(header))->cqi_indication_body.cqi_raw_pdu_list = 0;
}
break;
}
......
......@@ -64,7 +64,7 @@ nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create()
_this->_public.codec_config.deallocate = &free;
return &(_this->_public);
return (nfapi_vnf_p7_config_t*)(_this);
}
void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config)
......
......@@ -550,122 +550,122 @@ typedef struct ccparams_lte_s {
} ccparams_lte_t;
#define CCPARAMS_CHECK { \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T310_OKVALUES, UETIMER_T310_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T311_OKVALUES, UETIMER_T311_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N310_OKVALUES, UETIMER_N310_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N311_OKVALUES, UETIMER_N311_MODVALUES,8}} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} \
}
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* component carriers configuration parameters */
......
......@@ -255,93 +255,93 @@ typedef struct ccparams_eMTC_s {
}
#define EMTCPARAMS_CHECK { \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T310_OKVALUES, UETIMER_T310_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T311_OKVALUES, UETIMER_T311_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N310_OKVALUES, UETIMER_N310_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N311_OKVALUES, UETIMER_N311_MODVALUES,8}} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
}
#define SYSTEM_INFO_VALUE_TAG_SI_DESC(eMTCconfig) { \
......
......@@ -1116,13 +1116,15 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
first_rb = 23;
#else
first_rb = 46;
#endif break;
#endif
break;
case 100:
#ifndef PHY_RM
first_rb = 48;
#else
first_rb = 96;
#endif break;
#endif
break;
}
vrb_map[first_rb] = 1;
......
......@@ -951,7 +951,7 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->num_retransmission += 1;
eNB_UE_stats->rbs_used_retx = nb_rb;
eNB_UE_stats->total_rbs_used_retx += nb_rb;
eNB_UE_stats->dlsch_mcs[TB2] = eNB_UE_stats->dlsch_mcs[TB2];
//eNB_UE_stats->dlsch_mcs[TB2] = eNB_UE_stats->dlsch_mcs[TB2];
} else {
LOG_D(MAC,
"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n",
......
......@@ -174,9 +174,10 @@ rx_sdu(const module_id_t enb_mod_idP,
* maybe it's even not correct at all?
*/
UE_scheduling_control->ta_update = (UE_scheduling_control->ta_update * 3 + timing_advance) / 4;
UE_scheduling_control->pusch_snr[CC_idP] = (5 * ul_cqi - 640) / 10;
int tmp_snr = (5 * ul_cqi - 640) / 10;
UE_scheduling_control->pusch_snr[CC_idP] = tmp_snr;
if(UE_scheduling_control->pusch_snr[CC_idP] > 0 || UE_scheduling_control->pusch_snr[CC_idP] < 63) {
if(tmp_snr > 0 && tmp_snr < 63) {
double snr_filter_tpc=0.7;
int snr_thres_tpc=30;
int diff = UE_scheduling_control->pusch_snr_avg[CC_idP] - UE_scheduling_control->pusch_snr[CC_idP];
......
......@@ -68,8 +68,8 @@ pool_buffer_init (void)
//-----------------------------------------------------------------------------
uint32_t index, mb_index, pool_index;
mem_pool *memory = (mem_pool *) &mem_block_var;
memBlockVar=malloc(sizeof(mem_pool));
mem_pool *memory = (mem_pool *) &mem_block_var;
int pool_sizes[14] = { MEM_MNGT_MB0_NB_BLOCKS, MEM_MNGT_MB1_NB_BLOCKS,
MEM_MNGT_MB2_NB_BLOCKS, MEM_MNGT_MB3_NB_BLOCKS,
MEM_MNGT_MB4_NB_BLOCKS, MEM_MNGT_MB5_NB_BLOCKS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment