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

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Thu Jun 10 22:41:53 2010 +0200

analogy: cosmetic change (broken)

---

 include/analogy/device.h                           |    4 ++--
 ksrc/drivers/analogy/buffer.c                      |   14 +++++++-------
 ksrc/drivers/analogy/command.c                     |    2 +-
 ksrc/drivers/analogy/device.c                      |   16 ++++++++--------
 ksrc/drivers/analogy/instruction.c                 |    4 ++--
 .../analogy/national_instruments/mio_common.c      |    2 +-
 ksrc/drivers/analogy/subdevice.c                   |   10 +++++-----
 ksrc/drivers/analogy/testing/loop.c                |    2 +-
 8 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/include/analogy/device.h b/include/analogy/device.h
index 6930a38..fca40cc 100644
--- a/include/analogy/device.h
+++ b/include/analogy/device.h
@@ -33,7 +33,7 @@
 
 #define A4L_NB_DEVICES 10
 
-#define A4L_DEV_ATTACHED 0
+#define A4L_DEV_ATTACHED_NR 0
 
 struct a4l_device {
 
@@ -81,7 +81,7 @@ typedef struct a4l_dev_info a4l_dvinfo_t;
 #ifdef __KERNEL__
 
 /* --- Device related macro --- */
-#define a4l_check_dev(x) test_bit(A4L_DEV_ATTACHED, &(x->flags))
+#define a4l_dev_is_attached(x) test_bit(A4L_DEV_ATTACHED_NR, &(x->flags))
 
 /* --- Devices tab related functions --- */
 void a4l_init_devs(void);
diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 0826a93..ac1abce 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -513,7 +513,7 @@ int a4l_ioctl_cancel(a4l_cxt_t * cxt, void *arg)
        a4l_subd_t *subd;
 
        /* Basically check the device */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_cancel: operation not supported on "
                          "an unattached device\n");
                return -EINVAL;
@@ -556,7 +556,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg)
        }
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_bufcfg: unattached device\n");
                return -EINVAL;
        }
@@ -603,7 +603,7 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg)
                return -ENOSYS;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_bufinfo: unattached device\n");
                return -EINVAL;
        }
@@ -703,7 +703,7 @@ ssize_t a4l_read(a4l_cxt_t * cxt, void *bufdata, size_t 
nbytes)
 
        /* Basic checkings */
 
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_read: unattached device\n");
                return -EINVAL;
        }
@@ -803,7 +803,7 @@ ssize_t a4l_write(a4l_cxt_t *cxt,
 
        /* Basic checkings */
 
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_write: unattached device\n");
                return -EINVAL;
        }
@@ -893,7 +893,7 @@ int a4l_select(a4l_cxt_t *cxt,
 
        /* Basic checkings */
 
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_select: unattached device\n");
                return -EINVAL;
        }
@@ -942,7 +942,7 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg)
 
        /* Basic checking */
 
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_poll: unattached device\n");
                return -EINVAL;
        }
diff --git a/ksrc/drivers/analogy/command.c b/ksrc/drivers/analogy/command.c
index 94d6137..51aad35 100644
--- a/ksrc/drivers/analogy/command.c
+++ b/ksrc/drivers/analogy/command.c
@@ -303,7 +303,7 @@ int a4l_ioctl_cmd(a4l_cxt_t * cxt, void *arg)
                return -ENOSYS;
 
        /* Basically check the device */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_cmd: cannot command "
                          "an unattached device\n");
                return -EINVAL;
diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index a2d23c8..99b9098 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -51,7 +51,7 @@ int a4l_check_cleanup_devs(void)
        int i, ret = 0;
 
        for (i = 0; i < A4L_NB_DEVICES && ret == 0; i++)
-               if (test_bit(A4L_DEV_ATTACHED, &a4l_devs[i].flags))
+               if (test_bit(A4L_DEV_ATTACHED_NR, &a4l_devs[i].flags))
                        ret = -EBUSY;
 
        return ret;
@@ -60,7 +60,7 @@ int a4l_check_cleanup_devs(void)
 void a4l_set_dev(a4l_cxt_t *cxt)
 {
        /* Retrieve the minor index */
-       static int minor = a4l_get_minor(cxt);  
+       const int minor = a4l_get_minor(cxt);   
        /* Fill the dev fields accordingly */
        cxt->dev = &(a4l_devs[minor]);
 }
@@ -85,7 +85,7 @@ int a4l_rdproc_devs(char *page,
                if (a4l_devs[i].flags == 0) {
                        status = "Unused";
                        name = "No driver";
-               } else if (test_bit(A4L_DEV_ATTACHED, &a4l_devs[i].flags)) {
+               } else if (test_bit(A4L_DEV_ATTACHED_NR, &a4l_devs[i].flags)) {
                        status = "Linked";
                        name = a4l_devs[i].driver->board_name;
                } else {
@@ -412,7 +412,7 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
 
        if (arg == NULL) {
                /* Basic checking */
-               if (!test_bit(A4L_DEV_ATTACHED, &(a4l_get_dev(cxt)->flags))) {
+               if (!test_bit(A4L_DEV_ATTACHED_NR, &(a4l_get_dev(cxt)->flags))) 
{
                        __a4l_err("a4l_ioctl_devcfg: "
                                  "free device, no driver to detach\n");
                        return -EINVAL;
@@ -428,12 +428,12 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
                        return ret;
                /* Free the device and the driver from each other */
                if ((ret = a4l_device_detach(cxt)) == 0)
-                       clear_bit(A4L_DEV_ATTACHED,
+                       clear_bit(A4L_DEV_ATTACHED_NR,
                                  &(a4l_get_dev(cxt)->flags));
        } else {
                /* Basic checking */
                if (test_bit
-                   (A4L_DEV_ATTACHED, &(a4l_get_dev(cxt)->flags))) {
+                   (A4L_DEV_ATTACHED_NR, &(a4l_get_dev(cxt)->flags))) {
                        __a4l_err("a4l_ioctl_devcfg: "
                                  "linked device, cannot attach more driver\n");
                        return -EINVAL;
@@ -449,7 +449,7 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
                    (ret = a4l_proc_attach(cxt)) != 0)
                        a4l_device_detach(cxt);
                else
-                       set_bit(A4L_DEV_ATTACHED,
+                       set_bit(A4L_DEV_ATTACHED_NR,
                                &(a4l_get_dev(cxt)->flags));
        }
 
@@ -463,7 +463,7 @@ int a4l_ioctl_devinfo(a4l_cxt_t * cxt, void *arg)
 
        memset(&info, 0, sizeof(a4l_dvinfo_t));
 
-       if (test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                int len = (strlen(dev->driver->board_name) > A4L_NAMELEN) ?
                    A4L_NAMELEN : strlen(dev->driver->board_name);
 
diff --git a/ksrc/drivers/analogy/instruction.c 
b/ksrc/drivers/analogy/instruction.c
index 413c0d2..644c40c 100644
--- a/ksrc/drivers/analogy/instruction.c
+++ b/ksrc/drivers/analogy/instruction.c
@@ -296,7 +296,7 @@ int a4l_ioctl_insn(a4l_cxt_t * cxt, void *arg)
                return -ENOSYS;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_insn: unattached device\n");
                return -EINVAL;
        }
@@ -398,7 +398,7 @@ int a4l_ioctl_insnlist(a4l_cxt_t * cxt, void *arg)
                return -ENOSYS;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_insnlist: unattached device\n");
                return -EINVAL;
        }
diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c 
b/ksrc/drivers/analogy/national_instruments/mio_common.c
index 96d3100..46efd03 100644
--- a/ksrc/drivers/analogy/national_instruments/mio_common.c
+++ b/ksrc/drivers/analogy/national_instruments/mio_common.c
@@ -1028,7 +1028,7 @@ int ni_E_interrupt(unsigned int irq, void *d)
        unsigned long flags;
        struct mite_struct *mite = devpriv->mite;
 
-       if(!a4l_check_dev(dev))
+       if(!a4l_dev_is_attached(dev))
                return IRQ_NONE;
 
        /* Make sure dev->attached is checked before handler does
diff --git a/ksrc/drivers/analogy/subdevice.c b/ksrc/drivers/analogy/subdevice.c
index 1278081..9771d34 100644
--- a/ksrc/drivers/analogy/subdevice.c
+++ b/ksrc/drivers/analogy/subdevice.c
@@ -189,7 +189,7 @@ int a4l_ioctl_subdinfo(a4l_cxt_t * cxt, void *arg)
        a4l_sbinfo_t *subd_info;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_subdinfo: unattached device\n");
                return -EINVAL;
        }
@@ -225,7 +225,7 @@ int a4l_ioctl_nbchaninfo(a4l_cxt_t * cxt, void *arg)
        a4l_chinfo_arg_t inarg;
 
        /* Basic checking */
-       if (!dev->flags & A4L_DEV_ATTACHED) {
+       if (!dev->flags & A4L_DEV_ATTACHED_NR) {
                __a4l_err("a4l_ioctl_nbchaninfo: unattached device\n");
                return -EINVAL;
        }
@@ -265,7 +265,7 @@ int a4l_ioctl_chaninfo(a4l_cxt_t * cxt, void *arg)
        a4l_rngdesc_t *rng_desc;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_chaninfo: unattached device\n");
                return -EINVAL;
        }
@@ -331,7 +331,7 @@ int a4l_ioctl_nbrnginfo(a4l_cxt_t * cxt, void *arg)
        a4l_rngdesc_t *rng_desc;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_nbrnginfo: unattached device\n");
                return -EINVAL;
        }
@@ -386,7 +386,7 @@ int a4l_ioctl_rnginfo(a4l_cxt_t * cxt, void *arg)
        a4l_rnginfo_arg_t inarg;
 
        /* Basic checking */
-       if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {
+       if (!test_bit(A4L_DEV_ATTACHED_NR, &dev->flags)) {
                __a4l_err("a4l_ioctl_rnginfo: unattached device\n");
                return -EINVAL;
        }
diff --git a/ksrc/drivers/analogy/testing/loop.c 
b/ksrc/drivers/analogy/testing/loop.c
index 1f553c9..f73ad09 100644
--- a/ksrc/drivers/analogy/testing/loop.c
+++ b/ksrc/drivers/analogy/testing/loop.c
@@ -66,7 +66,7 @@ static void loop_task_proc(void *arg)
        a4l_subd_t *input_subd, *output_subd;
        lpprv_t *priv = (lpprv_t *)dev->priv;
     
-       while (!a4l_check_dev(dev))
+       while (!a4l_dev_is_attached(dev))
                a4l_task_sleep(LOOP_TASK_PERIOD);
 
        input_subd = a4l_get_subd(dev, LOOP_INPUT_SUBD);


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

Reply via email to