logging/nxscope: fix various warnings reported by CodeChekcer

fix various warnings reported by CodeChekcer for nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl
2024-08-12 13:43:02 +02:00
committed by Xiang Xiao
parent 877e4919cb
commit a8740c2602
4 changed files with 13 additions and 5 deletions

View File

@@ -1120,7 +1120,7 @@ int nxscope_recv(FAR struct nxscope_s *s)
/* Handle frame */
ret = nxscope_recv_handle(s, frame.id, frame.dlen, frame.data);
ret = nxscope_recv_handle(s, frame.id, (uint16_t)frame.dlen, frame.data);
if (ret < 0)
{
_err("ERROR: nxscope_recv_handle failed %d\n", ret);

View File

@@ -683,8 +683,8 @@ errout:
int nxscope_chan_all_en(FAR struct nxscope_s *s, bool en)
{
int ret = OK;
int i = 0;
int ret = OK;
uint8_t i = 0;
DEBUGASSERT(s);

View File

@@ -166,6 +166,16 @@ static int nxscope_frame_get(FAR struct nxscope_proto_s *p,
}
}
/* Check for no header */
if (hdr == NULL)
{
ret = -EINVAL;
goto errout;
}
/* Check for no SOF in header */
if (hdr->sof != NXSCOPE_HDR_SOF)
{
ret = -EINVAL;