public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* mmap fix in synth flash drivers
@ 2008-12-18  8:50 Simon Kallweit
  2008-12-22 20:07 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Kallweit @ 2008-12-18  8:50 UTC (permalink / raw)
  To: eCos Patches List

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

I found a small bug in the synth flash drivers. As I upgraded my system 
to 2GB RAM, the synth flash drivers stopped working, as the check of the 
mmap return value was wrong. Here is a patch to fix that.

Simon

[-- Attachment #2: flash_mmap_fix.patch --]
[-- Type: text/x-diff, Size: 2199 bytes --]

diff -r 32a1a041569f packages/devs/flash/synth/current/ChangeLog
--- a/packages/devs/flash/synth/current/ChangeLog	Thu Dec 18 09:34:13 2008 +0100
+++ b/packages/devs/flash/synth/current/ChangeLog	Thu Dec 18 09:48:30 2008 +0100
@@ -1,3 +1,7 @@
+2008-12-18  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* src/synth.c: Fixed error check of mmap call.
+
 2008-11-19  Simon Kallweit  <simon.kallweit@intefo.ch>
 
 	* tests/flash2.c: Fixed a few warnings.
diff -r 32a1a041569f packages/devs/flash/synth/current/src/synth.c
--- a/packages/devs/flash/synth/current/src/synth.c	Thu Dec 18 09:34:13 2008 +0100
+++ b/packages/devs/flash/synth/current/src/synth.c	Thu Dec 18 09:48:30 2008 +0100
@@ -124,9 +124,9 @@
                 |CYG_HAL_SYS_MAP_FIXED
 #endif
                 , cyg_dev_flash_synth_flashfd, 0 );
-    CYG_ASSERT( cyg_dev_flash_synth_base > 0, "mmap of flash file failed!" );
+    CYG_ASSERT( cyg_dev_flash_synth_base != (void *) -1, "mmap of flash file failed!" );
 
-    if (cyg_dev_flash_synth_base <= 0) {
+    if (cyg_dev_flash_synth_base == (void *) -1) {
         return FLASH_ERR_HWR;
     }
     flash_info.start = cyg_dev_flash_synth_base;
diff -r 32a1a041569f packages/devs/flash/synthv2/current/ChangeLog
--- a/packages/devs/flash/synthv2/current/ChangeLog	Thu Dec 18 09:34:13 2008 +0100
+++ b/packages/devs/flash/synthv2/current/ChangeLog	Thu Dec 18 09:48:30 2008 +0100
@@ -1,3 +1,7 @@
+2008-12-18  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* src/synth.c: Fixed error check of mmap call.
+
 2008-11-28  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
 
 	* tests/flash[23].c: Fixed copy'n'paste typos in a naming: flash1 ->
diff -r 32a1a041569f packages/devs/flash/synthv2/current/src/synth.c
--- a/packages/devs/flash/synthv2/current/src/synth.c	Thu Dec 18 09:34:13 2008 +0100
+++ b/packages/devs/flash/synthv2/current/src/synth.c	Thu Dec 18 09:48:30 2008 +0100
@@ -120,8 +120,8 @@
         flags,
         priv->flashfd, 
         0l);
-    CYG_ASSERT( (int) base > 0, "mmap of flash file failed!" );
-    if (base <= 0) {
+    CYG_ASSERT( base != -1, "mmap of flash file failed!" );
+    if (base == -1) {
         return CYG_FLASH_ERR_HWR;
     }
     dev->start = base;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mmap fix in synth flash drivers
  2008-12-18  8:50 mmap fix in synth flash drivers Simon Kallweit
@ 2008-12-22 20:07 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2008-12-22 20:07 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: eCos Patches List

On Thu, Dec 18, 2008 at 09:50:21AM +0100, Simon Kallweit wrote:
> I found a small bug in the synth flash drivers. As I upgraded my system  
> to 2GB RAM, the synth flash drivers stopped working, as the check of the  
> mmap return value was wrong. Here is a patch to fix that.

  Thanks for the patch,

  Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-22 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-18  8:50 mmap fix in synth flash drivers Simon Kallweit
2008-12-22 20:07 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).