This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: error in flashiodev.c
- From: Gary Thomas <gary at mlbassoc dot com>
- To: "Koeller, T." <Thomas dot Koeller at baslerweb dot com>
- Cc: "ecos-patches (E-Mail)" <ecos-patches at sources dot redhat dot com>
- Date: 19 Mar 2003 07:14:25 -0700
- Subject: Re: error in flashiodev.c
- References: <850597605E79D21182830008C7A4B9CF1EB42568@COMM1>
On Wed, 2003-03-19 at 07:04, Koeller, T. wrote:
> Hi,
>
> there is a trivial error in io/flash/current/src/flashiodev.c
>
Good catch. I've reformatted your patch (there were line breaks)
and cleaned up the function a bit for readability while I was in there.
Index: io/flash//current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/io/flash/current/ChangeLog,v
retrieving revision 1.25
diff -u -5 -p -r1.25 ChangeLog
--- io/flash//current/ChangeLog 3 Mar 2003 17:10:07 -0000 1.25
+++ io/flash//current/ChangeLog 19 Mar 2003 14:09:47 -0000
@@ -1,5 +1,9 @@
+2003-03-19 Thomas Koeller <thomas dot koeller at baslerweb dot com>
+
+ * src/flashiodev.c: Fixed trivial error.
+
2003-03-03 Knud Woehler <knud dot woehler at microplex dot de>
* src/flashiodev.c:
* cdl/io_flash.cdl: Add CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1 /
CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_1. Initialize the block device
Index: io/flash//current/src/flashiodev.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/io/flash/current/src/flashiodev.c,v
retrieving revision 1.3
diff -u -5 -p -r1.3 flashiodev.c
--- io/flash//current/src/flashiodev.c 3 Mar 2003 17:10:07 -0000 1.3
+++ io/flash//current/src/flashiodev.c 19 Mar 2003 14:13:01 -0000
@@ -77,38 +77,36 @@ static struct flashiodev_priv_t flashiod
static int dummy_printf( const char *fmt, ... ) {return 0;}
static bool
flashiodev_init( struct cyg_devtab_entry *tab )
{
- struct flashiodev_priv_t *dev = (struct flashiodev_priv_t *)tab->priv;
- char *ws = dev->workspace;
+ struct flashiodev_priv_t *dev = (struct flashiodev_priv_t *)tab->priv;
+ char *ws = dev->workspace;
int stat = flash_init( ws, FLASH_MIN_WORKSPACE, &dummy_printf );
- if ( stat == 0 )
- {
+ if ( stat == 0 ) {
#ifdef CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1
- CYG_ADDRESS flash_base;
- unsigned long size;
+ CYG_ADDRESS flash_base;
+ unsigned long size;
- if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_FLASH_BASE,
+ if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_FLASH_BASE,
CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1,
- &flash_base))
- return false;
- if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_SIZE,
- CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1,
- &size))
- return false;
+ &flash_base))
+ return false;
+ if(!CYGACC_CALL_IF_FLASH_FIS_OP(CYGNUM_CALL_IF_FLASH_FIS_GET_SIZE,
+ CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1,
+ &size))
+ return false;
- dev->start = (char *)flash_base;
- dev->end = (char *)flash_base + size;
+ dev->start = (char *)flash_base;
+ dev->end = (char *)flash_base + size;
#else
- dev->start = (char *)flash_info.start + CYGNUM_IO_FLASH_BLOCK_OFFSET_1;
- dev->end = (char *)flash_info.start + CYGNUM_IO_FLASH_BLOCK_OFFSET_1 +
- CYGNUM_IO_FLASH_BLOCK_LENGTH_1)
+ dev->start = (char *)flash_info.start + CYGNUM_IO_FLASH_BLOCK_OFFSET_1;
+ dev->end = (char *)flash_info.start + CYGNUM_IO_FLASH_BLOCK_OFFSET_1 +
+ CYGNUM_IO_FLASH_BLOCK_LENGTH_1;
#endif
return true;
- }
- else
+ } else
return false;
} // flashiodev_init()
#if 0
static Cyg_ErrNo
>
> diff -ru io_orig/flash/current/ChangeLog io/flash/current/ChangeLog
> --- io_orig/flash/current/ChangeLog Wed Mar 19 15:05:48 2003
> +++ io/flash/current/ChangeLog Wed Mar 19 15:04:56 2003
> @@ -1,3 +1,7 @@
> +2003-03-19 Thomas Koeller <thomas dot koeller at baslerweb dot com>
> +
> + * src/flashiodev.c: Fixed trivial error.
> +
> 2003-03-03 Knud Woehler <knud dot woehler at microplex dot de>
>
> * src/flashiodev.c:
> diff -ru io_orig/flash/current/src/flashiodev.c
> io/flash/current/src/flashiodev.c
> --- io_orig/flash/current/src/flashiodev.c Wed Mar 19 14:47:44 2003
> +++ io/flash/current/src/flashiodev.c Wed Mar 19 14:49:41 2003
> @@ -102,7 +102,7 @@
> #else
> dev->start = (char *)flash_info.start +
> CYGNUM_IO_FLASH_BLOCK_OFFSET_1;
> dev->end = (char *)flash_info.start +
> CYGNUM_IO_FLASH_BLOCK_OFFSET_1 +
> - CYGNUM_IO_FLASH_BLOCK_LENGTH_1)
> + CYGNUM_IO_FLASH_BLOCK_LENGTH_1;
> #endif
> return true;
> }
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary at mlbassoc dot com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------