Module: xenomai-abe
Branch: analogy
Commit: 63feb1800ab96e85877b72856dd8dca310c2cc70
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=63feb1800ab96e85877b72856dd8dca310c2cc70

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Fri Jan  7 00:39:53 2011 +0100

analogy: [fake] minor fix in attach parameters handling

---

 ksrc/drivers/analogy/testing/fake.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ksrc/drivers/analogy/testing/fake.c 
b/ksrc/drivers/analogy/testing/fake.c
index 803ff00..269981c 100644
--- a/ksrc/drivers/analogy/testing/fake.c
+++ b/ksrc/drivers/analogy/testing/fake.c
@@ -444,10 +444,11 @@ int test_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg)
 
        a4l_dbg(1, drv_dbg, dev, "starting attach procedure...\n");
 
-       if (arg->opts_size < sizeof(unsigned long)) {
-               priv->amplitude_div = 1;
-               priv->quanta_cnt = 1;
-       } else {
+       /* Set default values for attach parameters */
+       priv->amplitude_div = 1;
+       priv->quanta_cnt = 1;
+
+       if (arg->opts_size >= sizeof(unsigned long)) {
                unsigned long *args = (unsigned long *)arg->opts;
                priv->amplitude_div = args[0];
 


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

Reply via email to