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
spbro
OpenXG-RAN
Commits
efc5ce39
Commit
efc5ce39
authored
Jul 20, 2023
by
Vaibhav Shrivastava
Committed by
Laurent THOMAS
Aug 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cppcheck warnings related to nullPointerArithmeticRedundantCheck
parent
537605a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
19 deletions
+38
-19
nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
+15
-7
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
+10
-6
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+11
-5
openair1/PHY/TOOLS/cmult_sv.c
openair1/PHY/TOOLS/cmult_sv.c
+2
-1
No files found.
nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
View file @
efc5ce39
...
...
@@ -1485,17 +1485,23 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
int
nfapi_p4_message_pack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pPackedBuf
,
uint32_t
packedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pMessageBuf
;
uint8_t
*
end
=
pPackedBuf
+
packedBufLen
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
uint32_t
packedMsgLen
;
uint16_t
packedMsgLen16
;
if
(
pMessageBuf
==
NULL
||
pPackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 Pack supplied pointers are null
\n
"
);
if
(
pMessageBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 Pack supplied message buffer pointer is null
\n
"
);
return
-
1
;
}
if
(
packedBufLen
==
0
||
pPackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 Pack supplied packed buffer pointer is null or packed buffer length is 0
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
pPackedBuf
+
packedBufLen
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
// process the header
if
(
!
(
push16
(
pMessageHeader
->
phy_id
,
&
pWritePackedMessage
,
end
)
&&
push16
(
pMessageHeader
->
message_id
,
&
pWritePackedMessage
,
end
)
&&
...
...
@@ -1622,13 +1628,14 @@ int nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPack
int
nfapi_p4_message_header_unpack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pUnpackedBuf
,
uint32_t
unpackedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 header unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p4_p5_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 header unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
@@ -1648,13 +1655,14 @@ int nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
int
result
=
0
;
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p4_p5_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P4 unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
View file @
efc5ce39
...
...
@@ -1039,8 +1039,8 @@ static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd) {
int
nfapi_nr_p5_message_pack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pPackedBuf
,
uint32_t
packedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pMessageBuf
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackMessageEnd
=
pPackedBuf
+
packedBufLen
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
uint8_t
*
pPackMessageEnd
=
(
pWritePackedMessage
==
NULL
)
?
NULL
:
pPackedBuf
+
packedBufLen
;
uint8_t
*
pPackedLengthField
=
(
pWritePackedMessage
==
NULL
)
?
NULL
:
&
pWritePackedMessage
[
4
];
uint32_t
packedMsgLen
;
uint16_t
packedMsgLen16
;
...
...
@@ -1081,7 +1081,6 @@ int nfapi_nr_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pP
int
nfapi_p5_message_pack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pPackedBuf
,
uint32_t
packedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pMessageBuf
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackMessageEnd
=
pPackedBuf
+
packedBufLen
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
uint32_t
packedMsgLen
;
uint16_t
packedMsgLen16
;
...
...
@@ -1091,6 +1090,8 @@ int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPack
return
-
1
;
}
uint8_t
*
pPackMessageEnd
=
pPackedBuf
+
packedBufLen
;
// pack the message
if
(
push16
(
pMessageHeader
->
phy_id
,
&
pWritePackedMessage
,
pPackMessageEnd
)
&&
push16
(
pMessageHeader
->
message_id
,
&
pWritePackedMessage
,
pPackMessageEnd
)
&&
...
...
@@ -2105,13 +2106,14 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
int
nfapi_p5_message_header_unpack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pUnpackedBuf
,
uint32_t
unpackedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 header unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p4_p5_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 header unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
@@ -2127,13 +2129,14 @@ int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, vo
int
nfapi_nr_p5_message_unpack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pUnpackedBuf
,
uint32_t
unpackedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p4_p5_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
@@ -2262,13 +2265,14 @@ int nfapi_nr_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
int
nfapi_p5_message_unpack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pUnpackedBuf
,
uint32_t
unpackedBufLen
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_p4_p5_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p4_p5_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P5 unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
View file @
efc5ce39
...
...
@@ -3437,13 +3437,15 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
nfapi_p7_message_header_t
*
pMessageHeader
=
pMessageBuf
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
uint8_t
*
end
=
pPackedBuf
+
packedBufLen
;
if
(
pMessageBuf
==
NULL
||
pPackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 Pack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pPackedBuf
+
packedBufLen
;
// process the header
if
(
!
(
push16
(
pMessageHeader
->
phy_id
,
&
pWritePackedMessage
,
end
)
&&
push16
(
pMessageHeader
->
message_id
,
&
pWritePackedMessage
,
end
)
&&
...
...
@@ -3587,13 +3589,14 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
nfapi_p7_message_header_t
*
pMessageHeader
=
pMessageBuf
;
uint8_t
*
pWritePackedMessage
=
pPackedBuf
;
uint8_t
*
pPackedLengthField
=
&
pWritePackedMessage
[
4
];
uint8_t
*
end
=
pPackedBuf
+
packedBufLen
;
if
(
pMessageBuf
==
NULL
||
pPackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 Pack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pPackedBuf
+
packedBufLen
;
// process the header
if
(
!
(
push16
(
pMessageHeader
->
phy_id
,
&
pWritePackedMessage
,
end
)
&&
push16
(
pMessageHeader
->
message_id
,
&
pWritePackedMessage
,
end
)
&&
...
...
@@ -7797,13 +7800,14 @@ static int check_nr_unpack_length(nfapi_nr_phy_msg_type_e msgId, uint32_t unpack
int
nfapi_p7_message_header_unpack
(
void
*
pMessageBuf
,
uint32_t
messageBufLen
,
void
*
pUnpackedBuf
,
uint32_t
unpackedBufLen
,
nfapi_p7_codec_config_t
*
config
)
{
nfapi_p7_message_header_t
*
pMessageHeader
=
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 header unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_P7_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p7_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 header unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
@@ -7825,13 +7829,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
int
result
=
0
;
nfapi_p7_message_header_t
*
pMessageHeader
=
(
nfapi_p7_message_header_t
*
)
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 unpack supplied pointers are null
\n
"
);
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_P7_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p7_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
return
-
1
;
...
...
@@ -8061,7 +8066,6 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
int
result
=
0
;
nfapi_p7_message_header_t
*
pMessageHeader
=
(
nfapi_p7_message_header_t
*
)
pUnpackedBuf
;
uint8_t
*
pReadPackedMessage
=
pMessageBuf
;
uint8_t
*
end
=
pMessageBuf
+
messageBufLen
;
if
(
pMessageBuf
==
NULL
||
pUnpackedBuf
==
NULL
)
{
...
...
@@ -8069,6 +8073,8 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
return
-
1
;
}
uint8_t
*
end
=
(
uint8_t
*
)
pMessageBuf
+
messageBufLen
;
if
(
messageBufLen
<
NFAPI_P7_HEADER_LENGTH
||
unpackedBufLen
<
sizeof
(
nfapi_p7_message_header_t
))
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"P7 unpack supplied message buffer is too small %d, %d
\n
"
,
messageBufLen
,
unpackedBufLen
);
...
...
openair1/PHY/TOOLS/cmult_sv.c
View file @
efc5ce39
...
...
@@ -141,7 +141,8 @@ void rotate_cpx_vector(const c16_t *const x, const c16_t *const alpha, c16_t *y,
*
yd
=
simde_mm256_shuffle_epi8
(
tmp
,
perm_mask
);
}
c16_t
*
alpha16
=
(
c16_t
*
)
alpha
,
*
yLast
;
yLast
=
((
c16_t
*
)
y
)
+
(
N
/
8
)
*
8
;
if
(
y
!=
NULL
)
yLast
=
((
c16_t
*
)
y
)
+
(
N
/
8
)
*
8
;
for
(
c16_t
*
xTail
=
(
c16_t
*
)
end
;
xTail
<
((
c16_t
*
)
x
)
+
N
;
xTail
++
,
yLast
++
)
{
...
...
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