[ECOS] Question on disk_bwrite and disk_bread

Lecordier, Guy Guy.Lecordier@paclp.fr
Wed Jul 29 09:42:00 GMT 2009


Looking the code of disk_bread() and disk_bwrite() I see one difference
in a similar test:
In disk_bread()
            if (pos > last)
            {
                res = -EIO;
                break;
            }
In disk_bwrite()
            if (pos > last)
            {
                res = -EIO;
                goto done;
            }

The break leaves the while loop and then ctlr->busy = false;
It is what I want when the (funs->read) or (funs->write) return en
error.
So in disk_bread() & disk_bwrite() I replaced all the "goto done;" by
"break;"
So now the thread is not blocked and I am able to launch again a read or
write operation.

@@ -561,12 +561,12 @@
             cyg_drv_dsr_unlock();
             
             if (ENOERR != res)
-                goto done;
+                break;
 
             if (!info->connected)
             {
                 res = -EINVAL;
-                goto done;
+                break;
             }
 
             bbuf        += tfr * info->block_size;
@@ -637,7 +637,7 @@
             if (pos > last)
             {
                 res = -EIO;
-                goto done;
+                break;
             }
 
             if( tfr > info->ident.max_transfer )
@@ -665,12 +665,12 @@
             cyg_drv_dsr_unlock();
             
             if (ENOERR != res)
-                goto done;
+                break;
  
             if (!info->connected)
             {
                 res = -EINVAL;
-                goto done;
+                break;
             }
 
             bbuf        += tfr * info->block_size;

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list