summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-21 20:14:45 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-21 20:15:37 +0100
commit40a246616430ce578c3587d14a2302cfd94f1d0a (patch)
treeb721a7facbae05b00dfb6e7768201e5243c5d6c3
parentd4edbdbcbf39780499075c212463986dc8822f59 (diff)
downloadrtems-40a246616430ce578c3587d14a2302cfd94f1d0a.tar.bz2
sptests/spintrcritical23: Fix warnings
-rw-r--r--testsuites/sptests/spintrcritical23/init.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/testsuites/sptests/spintrcritical23/init.c b/testsuites/sptests/spintrcritical23/init.c
index ac9f1a105c..89fea25a12 100644
--- a/testsuites/sptests/spintrcritical23/init.c
+++ b/testsuites/sptests/spintrcritical23/init.c
@@ -67,23 +67,21 @@ static void change_priority(rtems_id timer, void *arg)
/* The arg is NULL */
test_context *ctx = &ctx_instance;
rtems_interrupt_lock_context lock_context;
- rtems_task_priority priority_interrupt;
- rtems_task_priority priority_task;
rtems_interrupt_lock_acquire(&ctx->lock, &lock_context);
if (
ctx->priority_generation != ctx->tcb->priority_generation
&& scheduler_node_unchanged(ctx)
) {
- ctx->done = true;
+ rtems_task_priority priority_interrupt;
+ rtems_task_priority priority_task;
+ rtems_task_priority previous;
+ rtems_status_code sc;
+
priority_interrupt = ctx->priority_interrupt;
priority_task = ctx->priority_task;
- }
- rtems_interrupt_lock_release(&ctx->lock, &lock_context);
- if (ctx->done) {
- rtems_status_code sc;
- rtems_task_priority previous;
+ rtems_interrupt_lock_release(&ctx->lock, &lock_context);
sc = rtems_task_set_priority(
ctx->task_id,
@@ -92,6 +90,10 @@ static void change_priority(rtems_id timer, void *arg)
);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
rtems_test_assert(previous == priority_task);
+
+ ctx->done = true;
+ } else {
+ rtems_interrupt_lock_release(&ctx->lock, &lock_context);
}
}