Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
60defa24
Commit
60defa24
authored
Feb 01, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more fixes for cppcheck
parent
d0a3788c
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
56 additions
and
59 deletions
+56
-59
ci-scripts/cppcheck_suppressions.list
ci-scripts/cppcheck_suppressions.list
+1
-1
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+24
-21
openair1/SCHED_UE/phy_procedures_lte_ue.c
openair1/SCHED_UE/phy_procedures_lte_ue.c
+1
-1
openair1/SIMULATION/LTE_PHY/ulsim.c
openair1/SIMULATION/LTE_PHY/ulsim.c
+3
-2
openair1/SIMULATION/TOOLS/abstraction.c
openair1/SIMULATION/TOOLS/abstraction.c
+1
-1
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
+1
-1
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
+3
-2
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+8
-16
openair2/RRC/LTE/rrc_eNB_S1AP.c
openair2/RRC/LTE/rrc_eNB_S1AP.c
+4
-4
openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h
...1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h
+1
-1
openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c
...1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c
+3
-3
openair3/NAS/COMMON/UTIL/tst/timer.c
openair3/NAS/COMMON/UTIL/tst/timer.c
+1
-1
openair3/NAS/TEST/NETWORK/network_simulator.c
openair3/NAS/TEST/NETWORK/network_simulator.c
+1
-1
openair3/NAS/TEST/USER/user_simulator.c
openair3/NAS/TEST/USER/user_simulator.c
+4
-4
No files found.
ci-scripts/cppcheck_suppressions.list
View file @
60defa24
...
...
@@ -33,7 +33,7 @@ memleak:common/utils/hashtable/obj_hashtable.c
// suppress error about keys memory leak, free must be done by calling func
memleak:openair2/UTIL/OMG/omg_hashtable.c
//-----------------------------------------------------------------------------
// suppress error about data memory leak. This is the buffer where
//
suppress error about data memory leak. This is the buffer where
// _emm_as_encode function creates the encoded buffer
//
memleak:openair3/NAS/UE/EMM/SAP/emm_as.c
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
60defa24
...
...
@@ -1545,7 +1545,7 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg,
// DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0)
int
push_ret
=
pusharray8
(
pdu
->
segments
[
j
].
segment_data
,
65535
,
pdu
->
segments
[
j
].
segment_length
,
ppWritePackedMsg
,
end
);
if
(
0
&&
pdu
->
segments
[
j
].
segment_length
==
3
)
if
(
pdu
->
segments
[
j
].
segment_length
==
3
)
{
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s() BCH? segment_data:%x %x %x
\n
"
,
__FUNCTION__
,
pdu
->
segments
[
j
].
segment_data
[
0
],
...
...
@@ -4429,40 +4429,43 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
for
(
i
=
0
;
i
<
totalNumPdus
;
++
i
)
{
nfapi_tx_request_pdu_t
*
pdu
=
&
(
pNfapiMsg
->
tx_request_body
.
tx_pdu_list
[
i
]);
if
(
pdu
)
{
uint16_t
length
=
0
;
uint16_t
index
=
0
;
uint16_t
length
=
0
;
uint16_t
index
=
0
;
if
(
!
(
pull16
(
ppReadPackedMsg
,
&
length
,
end
)
&&
if
(
!
(
pull16
(
ppReadPackedMsg
,
&
length
,
end
)
&&
pull16
(
ppReadPackedMsg
,
&
index
,
end
)))
return
0
;
return
0
;
pdu
->
pdu_length
=
length
;
pdu
->
pdu_index
=
index
;
pdu
->
pdu_length
=
length
;
pdu
->
pdu_index
=
index
;
// TODO : May need to rethink this bit
pdu
->
num_segments
=
1
;
pdu
->
segments
[
0
].
segment_length
=
pdu
->
pdu_length
;
pdu
->
segments
[
0
].
segment_data
=
nfapi_p7_allocate
(
pdu
->
pdu_length
,
config
);
pdu
->
num_segments
=
1
;
pdu
->
segments
[
0
].
segment_length
=
pdu
->
pdu_length
;
pdu
->
segments
[
0
].
segment_data
=
nfapi_p7_allocate
(
pdu
->
pdu_length
,
config
);
if
(
pdu
->
segments
[
0
].
segment_data
)
{
if
(
!
pullarray8
(
ppReadPackedMsg
,
pdu
->
segments
[
0
].
segment_data
,
pdu
->
segments
[
0
].
segment_length
,
pdu
->
segments
[
0
].
segment_length
,
end
))
if
(
pdu
->
segments
[
0
].
segment_data
)
{
if
(
!
pullarray8
(
ppReadPackedMsg
,
pdu
->
segments
[
0
].
segment_data
,
pdu
->
segments
[
0
].
segment_length
,
pdu
->
segments
[
0
].
segment_length
,
end
))
return
0
;
if
(
0
&&
pdu
->
segments
[
0
].
segment_length
==
3
)
{
if
(
pdu
->
segments
[
0
].
segment_length
==
3
)
{
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s() BCH? segment_data:%x %x %x
\n
"
,
__FUNCTION__
,
pdu
->
segments
[
0
].
segment_data
[
0
],
pdu
->
segments
[
0
].
segment_data
[
1
],
pdu
->
segments
[
0
].
segment_data
[
2
]
);
}
}
else
{
}
}
else
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d
\n
"
,
pdu
->
pdu_length
,
totalNumPdus
,
i
,
pdu
->
pdu_index
);
}
}
}
else
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"NULL pdu
\n
"
);
}
}
}
break
;
...
...
openair1/SCHED_UE/phy_procedures_lte_ue.c
View file @
60defa24
...
...
@@ -1902,7 +1902,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if
((
frame_parms
->
frame_type
==
FDD
)
||
(
bundling_flag
==
bundling
)
||
((
frame_parms
->
frame_type
==
TDD
)
&&
(
frame_parms
->
tdd_config
==
1
)
&&
((
subframe_tx
!=
2
)
||
(
subframe_tx
!
=
7
))))
{
((
frame_parms
->
frame_type
==
TDD
)
&&
(
frame_parms
->
tdd_config
==
1
)
&&
((
subframe_tx
==
2
)
||
(
subframe_tx
=
=
7
))))
{
format
=
pucch_format1a
;
// LOG_D(PHY,"[UE] PUCCH 1a\n");
}
else
{
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
60defa24
...
...
@@ -1047,7 +1047,7 @@ int main(int argc, char **argv) {
sigma2_dB
=
N0
;
//-10*log10(UE->frame_parms.ofdm_symbol_size/(UE->frame_parms.N_RB_DL*12));//10*log10((double)tx_lev) +10*log10(UE->frame_parms.ofdm_symbol_size/(UE->frame_parms.N_RB_DL*12)) - SNR;
sigma2
=
pow
(
10
,
sigma2_dB
/
10
);
// compute tx_gain to achieve target SNR (per resource element!)
tx_gain
=
sqrt
(
pow
(
10
.
0
,.
1
*
(
N0
+
SNR
))
/
(
double
)
tx_lev
);
//*(nb_rb*12/(double)UE->frame_parms.ofdm_symbol_size)/(double)tx_lev);
tx_gain
=
sqrt
(
pow
(
10
.
0
,.
1
*
(
N0
+
SNR
))
/
(
double
)
tx_lev
);
//
*(nb_rb*12/(double)UE->frame_parms.ofdm_symbol_size)/(double)tx_lev);
if
(
n_frames
==
1
)
printf
(
"tx_lev = %u (%u.%u dB,%f), gain %f
\n
"
,
tx_lev
,
tx_lev_dB
/
10
,
tx_lev_dB
,
10
*
log10
((
double
)
tx_lev
),
10
*
log10
(
tx_gain
));
...
...
@@ -1212,7 +1212,8 @@ int main(int argc, char **argv) {
dump_ulsch
(
eNB
,
eNB
->
proc
.
frame_rx
,
subframe
,
0
,
round
);
if
(
round
==
4
)
exit
(
-
1
);
round
=
5
;
}
if
(
n_frames
==
1
)
printf
(
"round %d errors %u/%u
\n
"
,
round
,
errs
[
round
],
trials
);
...
...
openair1/SIMULATION/TOOLS/abstraction.c
View file @
60defa24
...
...
@@ -254,7 +254,7 @@ void load_pbch_desc(FILE *pbch_file_fd) {
printf
(
"PBCH polynomial : "
);
for
(
i
=
0
;
i
<=
pbch_polynomial_degree
;
i
++
)
{
ret
=
fscanf
(
pbch_file_fd
,
"%s"
,
dummy
);
ret
=
fscanf
(
pbch_file_fd
,
"%
24
s"
,
dummy
);
if
(
ret
<
0
)
{
printf
(
"fscanf failed: %s
\n
"
,
strerror
(
errno
));
...
...
openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
View file @
60defa24
...
...
@@ -532,7 +532,7 @@ void rlc_am_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct ma
if
(
tb_src
!=
NULL
)
{
tb_size
=
((
struct
mac_tb_req
*
)
(
tb_src
->
data
))
->
tb_size_in_bits
>>
3
;
printf
(
"[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %
d
sizeof (mac_rlc_max_rx_header_size_t) %d
\n
"
,
printf
(
"[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %
u
sizeof (mac_rlc_max_rx_header_size_t) %d
\n
"
,
((
struct
mac_tb_req
*
)
(
tb_src
->
data
))
->
tb_size_in_bits
,
tb_size
,
sizeof
(
mac_rlc_max_rx_header_size_t
));
*
tx_packetsP
=
*
tx_packetsP
+
1
;
...
...
openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.c
View file @
60defa24
...
...
@@ -148,7 +148,8 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, uns
buffer_marker
=
0
;
}
buffer_marker
+=
snprintf
(
&
rlc_2_print_buffer
[
buffer_marker
],
RLC_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" %04ld |"
,
octet_index
);
buffer_marker
+=
snprintf
(
&
rlc_2_print_buffer
[
buffer_marker
],
RLC_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" %04lu |"
,
octet_index
);
}
/*
...
...
@@ -382,7 +383,7 @@ void rlc_um_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct ma
if
(
tb_src
!=
NULL
)
{
tb_size
=
((
struct
mac_tb_req
*
)
(
tb_src
->
data
))
->
tb_size_in_bits
>>
3
;
printf
(
"[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %
d
sizeof (mac_rlc_max_rx_header_size_t) %d
\n
"
,
printf
(
"[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %
u
sizeof (mac_rlc_max_rx_header_size_t) %d
\n
"
,
((
struct
mac_tb_req
*
)
(
tb_src
->
data
))
->
tb_size_in_bits
,
tb_size
,
sizeof
(
mac_rlc_max_rx_header_size_t
));
*
tx_packetsP
=
*
tx_packetsP
+
1
;
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
60defa24
...
...
@@ -1396,16 +1396,12 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
}
}
SRB_configList2
=
&
ue_context_pP
->
ue_context
.
SRB_configList2
[
next_xid
]
;
DRB_configList2
=
&
ue_context_pP
->
ue_context
.
DRB_configList2
[
next_xid
]
;
SRB_configList2
=
&
(
ue_context_pP
->
ue_context
.
SRB_configList2
[
next_xid
])
;
DRB_configList2
=
&
(
ue_context_pP
->
ue_context
.
DRB_configList2
[
next_xid
])
;
if
(
SRB_configList2
!=
NULL
)
{
if
(
*
SRB_configList2
)
{
free
(
*
SRB_configList2
);
LOG_D
(
RRC
,
"free(ue_context_pP->ue_context.SRB_configList2[%d])
\n
"
,
next_xid
);
}
}
else
{
LOG_E
(
RRC
,
"SRB_configList2 is null
\n
"
);
if
(
*
SRB_configList2
)
{
free
(
*
SRB_configList2
);
LOG_D
(
RRC
,
"free(ue_context_pP->ue_context.SRB_configList2[%d])
\n
"
,
next_xid
);
}
*
SRB_configList2
=
CALLOC
(
1
,
sizeof
(
**
SRB_configList2
));
...
...
@@ -1423,13 +1419,9 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
LOG_W
(
RRC
,
"SRB2 configuration does not exist in SRB configuration list
\n
"
);
}
if
(
DRB_configList2
!=
NULL
)
{
if
(
*
DRB_configList2
)
{
free
(
*
DRB_configList2
);
LOG_D
(
RRC
,
"free(ue_context_pP->ue_context.DRB_configList2[%d])
\n
"
,
next_xid
);
}
}
else
{
LOG_E
(
RRC
,
"DRB_configList2 is null
\n
"
);
if
(
*
DRB_configList2
)
{
free
(
*
DRB_configList2
);
LOG_D
(
RRC
,
"free(ue_context_pP->ue_context.DRB_configList2[%d])
\n
"
,
next_xid
);
}
*
DRB_configList2
=
CALLOC
(
1
,
sizeof
(
**
DRB_configList2
));
...
...
openair2/RRC/LTE/rrc_eNB_S1AP.c
View file @
60defa24
...
...
@@ -270,7 +270,7 @@ rrc_eNB_S1AP_get_ue_ids(
}
else
{
LOG_E
(
RRC
,
"[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist
\n
"
,
rrc_instance_pP
-
RC
.
rrc
[
0
],
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
,
(
ue_context_p
==
NULL
)
?
99999
:
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
,
eNB_ue_s1ap_id
,
result
->
ue_rnti
);
}
...
...
@@ -300,8 +300,7 @@ rrc_eNB_S1AP_remove_ue_ids(
)
//------------------------------------------------------------------------------
{
const
uint16_t
ue_initial_id
=
ue_ids_pP
->
ue_initial_id
;
const
uint32_t
eNB_ue_s1ap_id
=
ue_ids_pP
->
eNB_ue_s1ap_id
;
hashtable_rc_t
h_rc
;
if
(
rrc_instance_pP
==
NULL
)
{
...
...
@@ -313,7 +312,8 @@ rrc_eNB_S1AP_remove_ue_ids(
LOG_E
(
RRC
,
"Trying to free a NULL S1AP UE IDs
\n
"
);
return
;
}
const
uint16_t
ue_initial_id
=
ue_ids_pP
->
ue_initial_id
;
const
uint32_t
eNB_ue_s1ap_id
=
ue_ids_pP
->
eNB_ue_s1ap_id
;
if
(
eNB_ue_s1ap_id
>
0
)
{
h_rc
=
hashtable_remove
(
rrc_instance_pP
->
s1ap_id2_s1ap_ids
,
(
hash_key_t
)
eNB_ue_s1ap_id
);
...
...
openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h
View file @
60defa24
...
...
@@ -32,7 +32,7 @@ extern uint32_t g_log_level;
{ \
char _logStr[1024]; \
snprintf(_logStr, 1024, __VA_ARGS__); \
printf("NWGTPv2U-APP %s - %s <%s,%
u
>\n", gLogLevelStr[_logLevel], _logStr, basename(__FILE__), __LINE__);\
printf("NWGTPv2U-APP %s - %s <%s,%
d
>\n", gLogLevelStr[_logLevel], _logStr, basename(__FILE__), __LINE__);\
} \
} while(0)
...
...
openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c
View file @
60defa24
...
...
@@ -64,8 +64,8 @@ NwGtpv1uRcT nwTimerStart( NwGtpv1uTimerMgrHandleT tmrMgrHandle,
struct
timeval
tv
;
NW_LOG
(
NW_LOG_LEVEL_INFO
,
"Received start timer request from stack with timer type %
u, arg %x, for %u sec and %u
usec"
,
tmrType
,
timeoutArg
,
timeoutSec
,
timeoutUsec
);
"Received start timer request from stack with timer type %
d , arg %x, for %d sec and %d
usec"
,
tmrType
,
(
unsigned
int
)
timeoutArg
,
timeoutSec
,
timeoutUsec
);
pTmr
=
(
NwMiniTmrMgrEntityT
*
)
malloc
(
sizeof
(
NwMiniTmrMgrEntityT
));
...
...
@@ -90,7 +90,7 @@ NwGtpv1uRcT nwTimerStop( NwGtpv1uTimerMgrHandleT tmrMgrHandle,
NwGtpv1uTimerHandleT
hTmr
)
{
NW_LOG
(
NW_LOG_LEVEL_INFO
,
"Received stop timer request from stack for timer handle %
u
"
,
hTmr
);
"Received stop timer request from stack for timer handle %
d
"
,
hTmr
);
evtimer_del
(
&
(((
NwMiniTmrMgrEntityT
*
)
hTmr
)
->
ev
));
free
((
void
*
)
hTmr
);
return
NW_GTPV1U_OK
;
...
...
openair3/NAS/COMMON/UTIL/tst/timer.c
View file @
60defa24
...
...
@@ -96,7 +96,7 @@ int main (int argc, const char* argv[])
/* Start NB_TIMERS_MAX timers to expire at time interval of 1s */
for
(
int
i
=
0
;
i
<
NB_TIMERS_MAX
;
i
++
)
{
if
(
_start
(
&
timer
[
i
],
i
)
!=
RETURNok
)
{
printf
(
"ERROR: timer_start(i=%
u
) failed
\n
"
,
i
);
printf
(
"ERROR: timer_start(i=%
d
) failed
\n
"
,
i
);
}
}
...
...
openair3/NAS/TEST/NETWORK/network_simulator.c
View file @
60defa24
...
...
@@ -319,7 +319,7 @@ int main (int argc, const char* argv[])
_network_simulator_msg_sent
+=
1
;
}
printf
(
"
\n
INFO
\t
: %
d messages received, %d
messages sent
\n
"
,
printf
(
"
\n
INFO
\t
: %
u messages received, %u
messages sent
\n
"
,
_network_simulator_msg_recv
,
_network_simulator_msg_sent
);
}
...
...
openair3/NAS/TEST/USER/user_simulator.c
View file @
60defa24
...
...
@@ -143,7 +143,7 @@ int main (int argc, const char* argv[])
}
printf
(
"INFO
\t
: The User Simulator is now connected to %s (%d)
\n
"
,
devpath
,
USER_GETFD
());
devpath
,
(
int
)
USER_GETFD
());
}
else
{
/* Initialize network socket handlers */
_user_simulator_id
.
open
=
socket_udp_open
;
...
...
@@ -163,7 +163,7 @@ int main (int argc, const char* argv[])
}
printf
(
"INFO
\t
: The User Simulator is now connected to %s/%s (%d)
\n
"
,
host
,
port
,
USER_GETFD
());
host
,
port
,
(
int
)
USER_GETFD
());
}
...
...
@@ -231,7 +231,7 @@ int main (int argc, const char* argv[])
/*
* Termination cleanup
*/
printf
(
"INFO
\t
: Closing user endpoint descriptor %d
\n
"
,
USER_GETFD
());
printf
(
"INFO
\t
: Closing user endpoint descriptor %d
\n
"
,
(
int
)
USER_GETFD
());
USER_CLOSE
();
printf
(
"INFO
\t
: User simulator exited
\n
"
);
...
...
@@ -282,7 +282,7 @@ static int _set_signal_handler(int signal, void (handler)(int))
static
void
_signal_handler
(
int
signal_number
)
{
printf
(
"
\n
WARNING
\t
: Signal %d received
\n
"
,
signal_number
);
printf
(
"INFO
\t
: Closing user socket %d
\n
"
,
USER_GETFD
());
printf
(
"INFO
\t
: Closing user socket %d
\n
"
,
(
int
)
USER_GETFD
());
USER_CLOSE
();
printf
(
"INFO
\t
: User simulator exited
\n
"
);
exit
(
EXIT_SUCCESS
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment