Module: xenomai-head
Branch: master
Commit: 6e9806f0e55c05cf79b8a1754c655f0aa270524f
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6e9806f0e55c05cf79b8a1754c655f0aa270524f

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sun May 24 23:49:35 2009 +0200

Simplify munge function declaration

---

 include/comedi/buffer.h            |    8 ++++----
 include/comedi/subdevice.h         |    2 +-
 ksrc/drivers/comedi/buffer.c       |   12 ++++++------
 ksrc/drivers/comedi/testing/fake.c |    3 +--
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/include/comedi/buffer.h b/include/comedi/buffer.h
index 3339a64..3874f3e 100644
--- a/include/comedi/buffer.h
+++ b/include/comedi/buffer.h
@@ -145,9 +145,9 @@ static inline int __consume(comedi_cxt_t * cxt,
 }
 
 /* Munge procedure */
-static inline void __munge(struct comedi_device * dev,
-                          void (*munge) (struct comedi_device *, int, void *,
-                                         unsigned long), int idx_subd,
+static inline void __munge(struct comedi_subdevice * subd,
+                          void (*munge) (struct comedi_subdevice *, 
+                                         void *, unsigned long),
                           comedi_buf_t * buf, unsigned long count)
 {
        unsigned long start_ptr = (buf->mng_count % buf->size);
@@ -159,7 +159,7 @@ static inline void __munge(struct comedi_device * dev,
                    buf->size - start_ptr : tmp_cnt;
 
                /* Performs the munge operation */
-               munge(dev, idx_subd, buf->buf + start_ptr, blk_size);
+               munge(subd, buf->buf + start_ptr, blk_size);
 
                /* Updates the start pointer and the count */
                tmp_cnt -= blk_size;
diff --git a/include/comedi/subdevice.h b/include/comedi/subdevice.h
index 254dc88..e7aab0c 100644
--- a/include/comedi/subdevice.h
+++ b/include/comedi/subdevice.h
@@ -186,7 +186,7 @@ struct comedi_subdevice {
                                                       /**< Callback for 
command checking */
        int (*cancel) (struct comedi_subdevice *, int);
                                         /**< Callback for asynchronous 
transfer cancellation */
-       void (*munge) (struct comedi_device *, int, void *, unsigned long);
+       void (*munge) (struct comedi_subdevice *, void *, unsigned long);
                                                                /**< Callback 
for munge operation */
        int (*trigger) (struct comedi_subdevice *, lsampl_t);
                                              /**< Callback for trigger 
operation */
diff --git a/ksrc/drivers/comedi/buffer.c b/ksrc/drivers/comedi/buffer.c
index 7624362..2647d1c 100644
--- a/ksrc/drivers/comedi/buffer.c
+++ b/ksrc/drivers/comedi/buffer.c
@@ -505,9 +505,9 @@ int comedi_ioctl_bufinfo(comedi_cxt_t * cxt, void *arg)
 
        /* Performs the munge if need be */
        if (dev->transfer->subds[info.idx_subd]->munge != NULL) {
-               __munge(dev,
+               __munge(dev->transfer->subds[info.idx_subd],
                        dev->transfer->subds[info.idx_subd]->munge,
-                       info.idx_subd, buf, tmp_cnt);
+                       buf, tmp_cnt);
 
                /* Updates munge count */
                buf->mng_count += tmp_cnt;
@@ -565,9 +565,9 @@ ssize_t comedi_read(comedi_cxt_t * cxt, void *bufdata, 
size_t nbytes)
 
                        /* Performs the munge if need be */
                        if (dev->transfer->subds[idx_subd]->munge != NULL) {
-                               __munge(dev,
+                               __munge(dev->transfer->subds[idx_subd],
                                        dev->transfer->subds[idx_subd]->munge,
-                                       idx_subd, buf, tmp_cnt);
+                                       buf, tmp_cnt);
 
                                /* Updates munge count */
                                buf->mng_count += tmp_cnt;
@@ -662,9 +662,9 @@ ssize_t comedi_write(comedi_cxt_t *cxt,
 
                        /* Performs the munge if need be */
                        if (dev->transfer->subds[idx_subd]->munge != NULL) {
-                               __munge(dev,
+                               __munge(dev->transfer->subds[idx_subd],
                                        dev->transfer->subds[idx_subd]->munge,
-                                       idx_subd, buf, tmp_cnt);
+                                       buf, tmp_cnt);
 
                                /* Updates munge count */
                                buf->mng_count += tmp_cnt;
diff --git a/ksrc/drivers/comedi/testing/fake.c 
b/ksrc/drivers/comedi/testing/fake.c
index 8120368..149974b 100644
--- a/ksrc/drivers/comedi/testing/fake.c
+++ b/ksrc/drivers/comedi/testing/fake.c
@@ -212,8 +212,7 @@ int test_ai_insn_read(comedi_subd_t *subd, comedi_kinsn_t 
*insn)
 }
 
 /* Munge callback */
-void test_ai_munge(comedi_dev_t *dev, 
-                  int idx_subd, void *buf, unsigned long size)
+void test_ai_munge(comedi_subd_t *subd, void *buf, unsigned long size)
 {
        int i;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to