Module: xenomai-forge
Branch: rtdm-api-waitqueues
Commit: b57145a2add1a9472fa63756f6f928d8230f1444
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=b57145a2add1a9472fa63756f6f928d8230f1444

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 10 10:00:41 2014 +0200

analogy: drop useless atomic sections

We assume that memory transactions up to the native word width are
atomic for any architecture we support. Also, the affected code still
enforces proper memory barriers without the dropped locks.

---

 kernel/drivers/analogy/testing/fake.c |   30 +++++++++++++++---------------
 kernel/drivers/analogy/testing/loop.c |    6 +++---
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/kernel/drivers/analogy/testing/fake.c 
b/kernel/drivers/analogy/testing/fake.c
index 04dc2d2..3871cc5 100644
--- a/kernel/drivers/analogy/testing/fake.c
+++ b/kernel/drivers/analogy/testing/fake.c
@@ -241,15 +241,15 @@ static void task_proc(void *arg)
 
                int running;
 
-               RTDM_EXECUTE_ATOMICALLY(running = priv->ai_running);
+               running = priv->ai_running;
                if (running && ai_push_values(ai_subd) < 0)
                        break;
 
-               RTDM_EXECUTE_ATOMICALLY(running = priv->ao_running);
+               running = priv->ao_running;
                if (running && ao_pull_values(ao_subd) < 0)
                        break;
 
-               RTDM_EXECUTE_ATOMICALLY(running = priv->ai2_running);
+               running = priv->ai2_running;
                if (running && ai2_push_values(ai2_subd) < 0)
                        break;
 
@@ -277,7 +277,7 @@ static int ai_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
        ai_priv->current_ns = ((unsigned long)ai_priv->last_ns);
        ai_priv->reminder_ns = 0;
 
-       RTDM_EXECUTE_ATOMICALLY(priv->ai_running = 1);
+       priv->ai_running = 1;
 
        return 0;
 
@@ -302,7 +302,7 @@ static int ai_cancel(a4l_subd_t *subd)
 {
        struct fake_priv *priv = (struct fake_priv *)subd->dev->priv;
 
-       RTDM_EXECUTE_ATOMICALLY(priv->ai_running = 0);
+       priv->ai_running = 0;
 
        return 0;
 }
@@ -328,7 +328,7 @@ int ao_trigger(a4l_subd_t *subd, lsampl_t trignum)
        struct fake_priv *priv = (struct fake_priv *)subd->dev->priv;
 
        a4l_info(subd->dev, "ao_trigger: (subd=%d)\n", subd->idx);
-       RTDM_EXECUTE_ATOMICALLY(priv->ao_running = 1);
+       priv->ao_running = 1;
        return 0;
 }
 
@@ -339,17 +339,17 @@ int ao_cancel(a4l_subd_t *subd)
        int running;
 
        a4l_info(subd->dev, "ao_cancel: (subd=%d)\n", subd->idx);
-       RTDM_EXECUTE_ATOMICALLY(priv->ao_running = 0);
+       priv->ao_running = 0;
 
-       RTDM_EXECUTE_ATOMICALLY(running = priv->ai2_running);
+       running = priv->ai2_running;
        if (running) {
                a4l_subd_t *ai2_subd =
                        (a4l_subd_t *)a4l_get_subd(subd->dev, AI2_SUBD);
                /* Here, we have not saved the required amount of
                   data; so, we cannot know whether or not, it is the
                   end of the acquisition; that is why we force it */
-               RTDM_EXECUTE_ATOMICALLY(priv->ai2_running = 0);
-               RTDM_EXECUTE_ATOMICALLY(ao_priv->count = 0);
+               priv->ai2_running = 0;
+               ao_priv->count = 0;
                a4l_buf_evt(ai2_subd, A4L_BUF_EOA);
        }
 
@@ -363,7 +363,7 @@ int ai2_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
        struct fake_priv *priv = (struct fake_priv *)subd->dev->priv;
 
        a4l_info(subd->dev, "ai2_cmd: (subd=%d)\n", subd->idx);
-       RTDM_EXECUTE_ATOMICALLY(priv->ai2_running = 1);
+       priv->ai2_running = 1;
        return 0;
 }
 
@@ -375,17 +375,17 @@ int ai2_cancel(a4l_subd_t *subd)
        int running;
 
        a4l_info(subd->dev, "ai2_cancel: (subd=%d)\n", subd->idx);
-       RTDM_EXECUTE_ATOMICALLY(priv->ai2_running = 0);
+       priv->ai2_running = 0;
 
-       RTDM_EXECUTE_ATOMICALLY(running = priv->ao_running);
+       running = priv->ao_running;
        if (running) {
                a4l_subd_t *ao_subd =
                        (a4l_subd_t *)a4l_get_subd(subd->dev, AO_SUBD);
                /* Here, we have not saved the required amount of
                   data; so, we cannot know whether or not, it is the
                   end of the acquisition; that is why we force it */
-               RTDM_EXECUTE_ATOMICALLY(priv->ao_running = 0);
-               RTDM_EXECUTE_ATOMICALLY(ai2_priv->count = 0);
+               priv->ao_running = 0;
+               ai2_priv->count = 0;
                a4l_buf_evt(ao_subd, A4L_BUF_EOA);
        }
 
diff --git a/kernel/drivers/analogy/testing/loop.c 
b/kernel/drivers/analogy/testing/loop.c
index 709f0cf..e97535d 100644
--- a/kernel/drivers/analogy/testing/loop.c
+++ b/kernel/drivers/analogy/testing/loop.c
@@ -78,7 +78,7 @@ static void loop_task_proc(void *arg)
 
                int running;
 
-               RTDM_EXECUTE_ATOMICALLY(running = priv->loop_running);
+               running = priv->loop_running;
 
                if (running) {
                        uint16_t value;
@@ -128,7 +128,7 @@ int loop_trigger(a4l_subd_t *subd, lsampl_t trignum)
 
        a4l_info(subd->dev, "loop_trigger: (subd=%d)\n", subd->idx);
 
-       RTDM_EXECUTE_ATOMICALLY(priv->loop_running = 1);
+       priv->loop_running = 1;
 
        return 0;
 }
@@ -140,7 +140,7 @@ int loop_cancel(a4l_subd_t *subd)
 
        a4l_info(subd->dev, "loop_cancel: (subd=%d)\n", subd->idx);
 
-       RTDM_EXECUTE_ATOMICALLY(priv->loop_running = 0);
+       priv->loop_running = 0;
 
        return 0;
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to