Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
qosmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAL
qosmngr
Commits
e3d608e4
Commit
e3d608e4
authored
3 years ago
by
Vivek Dutta
Browse files
Options
Downloads
Patches
Plain Diff
Fix static code analysis errors
parent
46032701
Branches
Branches containing commit
No related tags found
1 merge request
!11
Fix static code analysis errors
Pipeline
#40499
passed
3 years ago
Stage: static_code_analysis
Stage: functional_test
Stage: api_test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
src/qosmngr.c
+9
-6
9 additions, 6 deletions
src/qosmngr.c
test/cmocka/functional_test_qos.c
+1
-2
1 addition, 2 deletions
test/cmocka/functional_test_qos.c
with
11 additions
and
8 deletions
.gitlab-ci.yml
+
1
−
0
View file @
e3d608e4
...
@@ -11,6 +11,7 @@ stages:
...
@@ -11,6 +11,7 @@ stages:
variables
:
variables
:
DEBUG
:
'
TRUE'
DEBUG
:
'
TRUE'
SOURCE_FOLDER
:
"
."
SOURCE_FOLDER
:
"
."
RUN_CPPCHECK
:
"
cppcheck
--enable=all
--error-exitcode=1
${SOURCE_FOLDER}"
run_api_test
:
run_api_test
:
stage
:
api_test
stage
:
api_test
...
...
This diff is collapsed.
Click to expand it.
src/qosmngr.c
+
9
−
6
View file @
e3d608e4
...
@@ -263,13 +263,14 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
...
@@ -263,13 +263,14 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
static
int
get_stats_by_ifname
(
struct
blob_buf
*
b
,
struct
qos_stats
*
stats
,
void
*
dd
,
static
int
get_stats_by_ifname
(
struct
blob_buf
*
b
,
struct
qos_stats
*
stats
,
void
*
dd
,
char
*
ifname
,
int
qid
)
char
*
ifname
,
int
qid
)
{
{
int
queues
=
0
;
int
ret
=
0
;
int
i
,
ret
=
0
;
if
(
qid
>=
0
)
{
if
(
qid
>=
0
)
{
ret
=
prepare_stats_blob
(
b
,
stats
,
dd
,
ifname
,
qid
);
ret
=
prepare_stats_blob
(
b
,
stats
,
dd
,
ifname
,
qid
);
}
else
{
}
else
{
queues
=
get_no_queues
(
ifname
);
int
i
;
int
queues
=
get_no_queues
(
ifname
);
for
(
i
=
0
;
i
<
queues
;
i
++
)
{
for
(
i
=
0
;
i
<
queues
;
i
++
)
{
ret
=
prepare_stats_blob
(
b
,
stats
,
dd
,
ifname
,
i
);
ret
=
prepare_stats_blob
(
b
,
stats
,
dd
,
ifname
,
i
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
...
@@ -332,17 +333,19 @@ static int validate_keys(char *req_json)
...
@@ -332,17 +333,19 @@ static int validate_keys(char *req_json)
int
len
=
strlen
(
req_json
);
int
len
=
strlen
(
req_json
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
char
key
[
IFNAMSIZ
]
=
{
0
};
if
(
req_json
[
i
]
==
QUOTE
)
{
if
(
req_json
[
i
]
==
QUOTE
)
{
char
key
[
IFNAMSIZ
]
=
{
0
};
int
j
=
0
;
int
j
=
0
;
i
++
;
i
++
;
while
(
req_json
[
i
]
!=
QUOTE
)
{
while
((
i
<
len
)
&&
(
req_json
[
i
]
!=
QUOTE
))
{
key
[
j
]
=
req_json
[
i
];
key
[
j
]
=
req_json
[
i
];
j
++
;
j
++
;
i
++
;
i
++
;
}
}
i
++
;
i
++
;
while
((
req_json
[
i
]
!=
SEPERATOR
)
&&
(
i
<
len
))
while
((
i
<
len
)
&&
(
req_json
[
i
]
!=
SEPERATOR
))
i
++
;
i
++
;
if
(
!
(
!
strncmp
(
key
,
PARAM1
,
strlen
(
PARAM1
))
||
if
(
!
(
!
strncmp
(
key
,
PARAM1
,
strlen
(
PARAM1
))
||
...
...
This diff is collapsed.
Click to expand it.
test/cmocka/functional_test_qos.c
+
1
−
2
View file @
e3d608e4
...
@@ -77,7 +77,6 @@ static void validate_queues(struct json_object *queues)
...
@@ -77,7 +77,6 @@ static void validate_queues(struct json_object *queues)
{
{
int
i
;
int
i
;
int
len
;
int
len
;
struct
json_object
*
queue
;
assert_non_null
(
queues
);
assert_non_null
(
queues
);
len
=
json_object_array_length
(
queues
);
len
=
json_object_array_length
(
queues
);
...
@@ -86,7 +85,7 @@ static void validate_queues(struct json_object *queues)
...
@@ -86,7 +85,7 @@ static void validate_queues(struct json_object *queues)
assert_true
(
len
>=
0
);
assert_true
(
len
>=
0
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
queue
=
json_object_array_get_idx
(
queues
,
i
);
struct
json_object
*
queue
=
json_object_array_get_idx
(
queues
,
i
);
json_object_object_foreach
(
queue
,
key
,
val
)
{
json_object_object_foreach
(
queue
,
key
,
val
)
{
int
val_type
=
json_object_get_type
(
val
);
int
val_type
=
json_object_get_type
(
val
);
switch
(
val_type
)
{
switch
(
val_type
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment