Commit dfd73be6 by Marcus Winter

mtapi_c: fixed codesonar warnings

parent e7734ca3
...@@ -166,7 +166,7 @@ void embb_mtapi_job_remove_action( ...@@ -166,7 +166,7 @@ void embb_mtapi_job_remove_action(
embb_mtapi_action_t * action) { embb_mtapi_action_t * action) {
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
assert(MTAPI_NULL != action); assert(MTAPI_NULL != action);
mtapi_uint_t ii = 0; mtapi_uint_t ii;
for (ii = 0; ii + 1 < that->num_actions; ii++) { for (ii = 0; ii + 1 < that->num_actions; ii++) {
if (that->actions[ii].id == action->handle.id && if (that->actions[ii].id == action->handle.id &&
......
...@@ -325,7 +325,7 @@ mtapi_queue_hndl_t mtapi_queue_get( ...@@ -325,7 +325,7 @@ mtapi_queue_hndl_t mtapi_queue_get(
if (embb_mtapi_node_is_initialized()) { if (embb_mtapi_node_is_initialized()) {
embb_mtapi_node_t* node = embb_mtapi_node_get_instance(); embb_mtapi_node_t* node = embb_mtapi_node_get_instance();
mtapi_uint_t ii = 0; mtapi_uint_t ii;
local_status = MTAPI_ERR_QUEUE_INVALID; local_status = MTAPI_ERR_QUEUE_INVALID;
for (ii = 0; ii < node->attributes.max_queues; ii++) { for (ii = 0; ii < node->attributes.max_queues; ii++) {
......
...@@ -78,8 +78,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_vhpf( ...@@ -78,8 +78,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_vhpf(
embb_mtapi_node_t * node, embb_mtapi_node_t * node,
embb_mtapi_thread_context_t * thread_context) { embb_mtapi_thread_context_t * thread_context) {
embb_mtapi_task_t * task = MTAPI_NULL; embb_mtapi_task_t * task = MTAPI_NULL;
mtapi_uint_t ii = 0; mtapi_uint_t ii;
mtapi_uint_t kk = 0;
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
assert(MTAPI_NULL != node); assert(MTAPI_NULL != node);
...@@ -102,6 +101,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_vhpf( ...@@ -102,6 +101,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_vhpf(
*/ */
mtapi_uint_t context_index = mtapi_uint_t context_index =
(thread_context->worker_index + 1) % that->worker_count; (thread_context->worker_index + 1) % that->worker_count;
mtapi_uint_t kk;
for (kk = 0; for (kk = 0;
kk < that->worker_count - 1 && MTAPI_NULL == task; kk < that->worker_count - 1 && MTAPI_NULL == task;
kk++) { kk++) {
...@@ -121,8 +121,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_lf( ...@@ -121,8 +121,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_lf(
embb_mtapi_node_t * node, embb_mtapi_node_t * node,
embb_mtapi_thread_context_t * thread_context) { embb_mtapi_thread_context_t * thread_context) {
embb_mtapi_task_t * task = MTAPI_NULL; embb_mtapi_task_t * task = MTAPI_NULL;
mtapi_uint_t prio = 0; mtapi_uint_t prio;
mtapi_uint_t kk = 0;
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
assert(MTAPI_NULL != node); assert(MTAPI_NULL != node);
...@@ -153,6 +152,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_lf( ...@@ -153,6 +152,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_lf(
prio++) { prio++) {
mtapi_uint_t context_index = mtapi_uint_t context_index =
(thread_context->worker_index + 1) % that->worker_count; (thread_context->worker_index + 1) % that->worker_count;
mtapi_uint_t kk;
for (kk = 0; for (kk = 0;
kk < that->worker_count - 1 && MTAPI_NULL == task; kk < that->worker_count - 1 && MTAPI_NULL == task;
kk++) { kk++) {
...@@ -195,7 +195,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task( ...@@ -195,7 +195,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task(
embb_mtapi_thread_context_t * embb_mtapi_scheduler_get_current_thread_context( embb_mtapi_thread_context_t * embb_mtapi_scheduler_get_current_thread_context(
embb_mtapi_scheduler_t * that) { embb_mtapi_scheduler_t * that) {
mtapi_uint_t ii = 0; mtapi_uint_t ii;
embb_mtapi_thread_context_t * context = NULL; embb_mtapi_thread_context_t * context = NULL;
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
...@@ -433,7 +433,7 @@ mtapi_boolean_t embb_mtapi_scheduler_initialize_with_mode( ...@@ -433,7 +433,7 @@ mtapi_boolean_t embb_mtapi_scheduler_initialize_with_mode(
embb_mtapi_scheduler_t * that, embb_mtapi_scheduler_t * that,
embb_mtapi_scheduler_mode_t mode) { embb_mtapi_scheduler_mode_t mode) {
embb_mtapi_node_t* node = embb_mtapi_node_get_instance(); embb_mtapi_node_t* node = embb_mtapi_node_get_instance();
mtapi_uint_t ii = 0; mtapi_uint_t ii;
embb_mtapi_log_trace("embb_mtapi_scheduler_initialize() called\n"); embb_mtapi_log_trace("embb_mtapi_scheduler_initialize() called\n");
...@@ -480,7 +480,7 @@ mtapi_boolean_t embb_mtapi_scheduler_initialize_with_mode( ...@@ -480,7 +480,7 @@ mtapi_boolean_t embb_mtapi_scheduler_initialize_with_mode(
} }
void embb_mtapi_scheduler_finalize(embb_mtapi_scheduler_t * that) { void embb_mtapi_scheduler_finalize(embb_mtapi_scheduler_t * that) {
mtapi_uint_t ii = 0; mtapi_uint_t ii;
embb_mtapi_log_trace("embb_mtapi_scheduler_finalize() called\n"); embb_mtapi_log_trace("embb_mtapi_scheduler_finalize() called\n");
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment