Skip to content
GitLab
Explore
Sign in
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
ca602576
Commit
ca602576
authored
2 years ago
by
Maxim Menshikov
Browse files
Options
Downloads
Patches
Plain Diff
qosmngr: fix errors reported by static analysis
parent
48e212bb
Branches
mmenshikov-qosmngr-cflags
Branches containing commit
No related tags found
1 merge request
!13
qosmngr: consider more warnings as errors and fix discovered issues
Pipeline
#79819
passed
2 years ago
Stage: static_code_analysis
Stage: functional_test
Stage: api_test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/qosmngr.c
+12
-12
12 additions, 12 deletions
src/qosmngr.c
with
12 additions
and
12 deletions
src/qosmngr.c
+
12
−
12
View file @
ca602576
...
...
@@ -128,7 +128,7 @@ static int get_interface_index(const char *ifname)
* @param none
* retrun integer value 0 on success and -1 on failure
*/
static
int
init_qstat
()
static
int
init_qstat
(
void
)
{
int
ret
=
0
;
int
index
=
0
;
...
...
@@ -169,9 +169,9 @@ static int init_qstat()
if
(
uci_sec
)
{
qos_interface_data
*
data
=
&
interfaces
[
index
];
struct
uci_option
*
uci_opn
=
uci_lookup_option
(
uci_ctx
,
uci_sec
,
"ifname"
);
int
queues
;
size_t
queues
;
queues
=
get_no_queues
(
uci_opn
->
v
.
string
);
queues
=
(
size_t
)
get_no_queues
(
uci_opn
->
v
.
string
);
strcpy
(
data
->
if_name
,
uci_opn
->
v
.
string
);
data
->
q_count
=
queues
;
data
->
q_stat
=
(
struct
qos_stats
*
)
calloc
(
queues
,
...
...
@@ -260,11 +260,11 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
dd
=
blobmsg_open_table
(
b
,
""
);
blobmsg_add_string
(
b
,
"iface"
,
ifname
);
blobmsg_add_u32
(
b
,
"qid"
,
qid
);
blobmsg_add_u32
(
b
,
"tx_packets"
,
q_stat
->
tx_packets
);
blobmsg_add_u32
(
b
,
"tx_bytes"
,
q_stat
->
tx_bytes
);
blobmsg_add_u32
(
b
,
"tx_dropped_packets"
,
q_stat
->
tx_dropped_packets
);
blobmsg_add_u32
(
b
,
"tx_dropped_bytes"
,
q_stat
->
tx_dropped_bytes
);
blobmsg_add_u32
(
b
,
"qid"
,
(
uint32_t
)
qid
);
blobmsg_add_u32
(
b
,
"tx_packets"
,
(
uint32_t
)
q_stat
->
tx_packets
);
blobmsg_add_u32
(
b
,
"tx_bytes"
,
(
uint32_t
)
q_stat
->
tx_bytes
);
blobmsg_add_u32
(
b
,
"tx_dropped_packets"
,
(
uint32_t
)
q_stat
->
tx_dropped_packets
);
blobmsg_add_u32
(
b
,
"tx_dropped_bytes"
,
(
uint32_t
)
q_stat
->
tx_dropped_bytes
);
blobmsg_close_table
(
b
,
dd
);
...
...
@@ -347,15 +347,15 @@ static int get_stats_for_all_intf(struct blob_buf *b, struct qos_stats *stats, v
*/
static
int
validate_keys
(
char
*
req_json
)
{
in
t
i
;
size_
t
i
;
int
ret
=
0
;
in
t
len
=
strlen
(
req_json
);
size_
t
len
=
strlen
(
req_json
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
req_json
[
i
]
==
QUOTE
)
{
char
key
[
IFNAMSIZ
]
=
{
0
};
in
t
j
=
0
;
size_
t
j
=
0
;
i
++
;
while
((
i
<
len
)
&&
(
req_json
[
i
]
!=
QUOTE
))
{
...
...
@@ -436,7 +436,7 @@ int qosmngr_get_stats(struct ubus_context *ctx, struct ubus_object *obj,
/* Parse optional arguments */
if
(
tb
[
QOS_POLICY_QID
])
qid
=
blobmsg_get_u32
(
tb
[
QOS_POLICY_QID
]);
qid
=
(
int
)
blobmsg_get_u32
(
tb
[
QOS_POLICY_QID
]);
/* Can't have a queue id specified without an interface */
if
(
tb
[
QOS_POLICY_QID
]
&&
!
tb
[
QOS_POLICY_IFNAME
])
...
...
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