[Xenomai-git] Alexis Berlemont : analogy: remove a4l_subd_is_busy calls in analogy core

2010-08-02 Thread GIT version control
Module: xenomai-head
Branch: master
Commit: 66b3928db8b1736b350c351fcfe6ae5525e19e78
URL:
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=66b3928db8b1736b350c351fcfe6ae5525e19e78

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Jun 23 21:01:46 2010 +0200

analogy: remove a4l_subd_is_busy calls in analogy core

---

 ksrc/drivers/analogy/buffer.c |   42 
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 12b8b9b..b8b01d3 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -175,8 +175,8 @@ int a4l_cancel_buffer(a4l_cxt_t *cxt)
a4l_subd_t *subd = buf_desc-subd;

int err = 0;
-   
-   if (!subd || !a4l_subd_is_busy(subd))
+
+   if (!subd || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return 0;
 
/* If a cancel function is registered, call it
@@ -253,7 +253,7 @@ int a4l_buf_prepare_absput(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -267,7 +267,7 @@ int a4l_buf_commit_absput(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -280,7 +280,7 @@ int a4l_buf_prepare_put(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -293,7 +293,7 @@ int a4l_buf_commit_put(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -307,7 +307,7 @@ int a4l_buf_put(a4l_subd_t *subd, void *bufdata, unsigned 
long count)
a4l_buf_t *buf = subd-buf;
int err;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -329,7 +329,7 @@ int a4l_buf_prepare_absget(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -342,7 +342,7 @@ int a4l_buf_commit_absget(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -355,7 +355,7 @@ int a4l_buf_prepare_get(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -370,7 +370,7 @@ int a4l_buf_commit_get(a4l_subd_t *subd, unsigned long 
count)
 
/* Basic checkings */
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -386,12 +386,12 @@ int a4l_buf_get(a4l_subd_t *subd, void *bufdata, unsigned 
long count)
 
/* Basic checkings */
 
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
+   return -ENOENT;
+
if (!a4l_subd_is_output(subd))
return -EINVAL;
 
-   if (!buf || !a4l_subd_is_busy(subd))
-   return -ENOENT;
-
if (__count_to_get(buf)  count)
return -EAGAIN;
 
@@ -418,7 +418,7 @@ int a4l_buf_evt(a4l_subd_t *subd, unsigned long evts)
   race conditions, not the framework */
 
/* Basic checking */
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
/* Even if it is a little more complex,
@@ -441,7 +441,7 @@ unsigned long a4l_buf_count(a4l_subd_t *subd)
unsigned long ret = 0;
 
/* Basic checking */
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (a4l_subd_is_input(subd))
@@ -587,7 +587,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg)
 arg, sizeof(a4l_bufcfg_t)) != 0)
return 

[Xenomai-git] Alexis Berlemont : analogy: remove a4l_subd_is_busy calls in analogy core

2010-06-24 Thread GIT version control
Module: xenomai-abe
Branch: experimental
Commit: 321bbbc1dfd365383b6eade66243538c108381da
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=321bbbc1dfd365383b6eade66243538c108381da

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Jun 23 21:01:46 2010 +0200

analogy: remove a4l_subd_is_busy calls in analogy core

---

 ksrc/drivers/analogy/buffer.c |   42 
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 12b8b9b..b8b01d3 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -175,8 +175,8 @@ int a4l_cancel_buffer(a4l_cxt_t *cxt)
a4l_subd_t *subd = buf_desc-subd;

int err = 0;
-   
-   if (!subd || !a4l_subd_is_busy(subd))
+
+   if (!subd || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return 0;
 
/* If a cancel function is registered, call it
@@ -253,7 +253,7 @@ int a4l_buf_prepare_absput(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -267,7 +267,7 @@ int a4l_buf_commit_absput(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -280,7 +280,7 @@ int a4l_buf_prepare_put(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -293,7 +293,7 @@ int a4l_buf_commit_put(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -307,7 +307,7 @@ int a4l_buf_put(a4l_subd_t *subd, void *bufdata, unsigned 
long count)
a4l_buf_t *buf = subd-buf;
int err;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_input(subd))
@@ -329,7 +329,7 @@ int a4l_buf_prepare_absget(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -342,7 +342,7 @@ int a4l_buf_commit_absget(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -355,7 +355,7 @@ int a4l_buf_prepare_get(a4l_subd_t *subd, unsigned long 
count)
 {
a4l_buf_t *buf = subd-buf;
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -370,7 +370,7 @@ int a4l_buf_commit_get(a4l_subd_t *subd, unsigned long 
count)
 
/* Basic checkings */
 
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (!a4l_subd_is_output(subd))
@@ -386,12 +386,12 @@ int a4l_buf_get(a4l_subd_t *subd, void *bufdata, unsigned 
long count)
 
/* Basic checkings */
 
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
+   return -ENOENT;
+
if (!a4l_subd_is_output(subd))
return -EINVAL;
 
-   if (!buf || !a4l_subd_is_busy(subd))
-   return -ENOENT;
-
if (__count_to_get(buf)  count)
return -EAGAIN;
 
@@ -418,7 +418,7 @@ int a4l_buf_evt(a4l_subd_t *subd, unsigned long evts)
   race conditions, not the framework */
 
/* Basic checking */
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
/* Even if it is a little more complex,
@@ -441,7 +441,7 @@ unsigned long a4l_buf_count(a4l_subd_t *subd)
unsigned long ret = 0;
 
/* Basic checking */
-   if (!buf || !a4l_subd_is_busy(subd))
+   if (!buf || !test_bit(A4L_SUBD_BUSY_NR, subd-status))
return -ENOENT;
 
if (a4l_subd_is_input(subd))
@@ -587,7 +587,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg)
 arg, sizeof(a4l_bufcfg_t)) != 0)