Skip to contentSkip to conversation

fxload putting code at a wrong place

PATCH Matthieu Lochegnies 2 participants 2 messages Jan 17, 2002

lore
Share & tools
lore
#0 lore raw

High !

I just bought an Ez USB development kit and tried to play with it
using fxload. The new merging algorithm seems to forget to initialize data_addr.

Attached is a small patch that, I think, fixes it.

Regards,

Signature · 1 line
Matthieu Lochegnies

Index: ezusb.c
===================================================================
RCS file: /cvsroot/linux-hotplug/admin/fxload/ezusb.c,v retrieving revision 1.3

ezusb.c +8 -0
diff -u -r1.3 ezusb.c
@@ -130,6 +130,7 @@
       FILE*image;
       int rc;
       unsigned short cpucs_addr;
+      unsigned char first_line = 1;
 
       /* EZ-USB FX and FX2 devices differ, apart from the 8051 core */
       if (fx2)
@@ -186,6 +187,13 @@
 	    buf[7] = 0;
 	    off = strtoul(buf+3, 0, 16);
 	    buf[7] = tmp;
+
+              /* Initialize data_addr */
+            if( first_line )
+            {
+              data_addr = off;
+              first_line = 0;
+            }
 
 	      /* Read the record type */
 	    tmp = buf[9];
#1 lore raw

Whoops! Good catch. I also added "-Wall" to CFLAGS in the Makefile (one gets used to having compilers tell about such bugs :) and fixed the other warnings (minor) too. All in CVS now.

Curious ... the firmware I tested with didn't misbehave with that bug in place. But this fixes a problem I was scratching my head about yesterday ... thanks!

- Dave

----- Original Message -----
From: "Matthieu Lochegnies" <[email protected]>
To: <[email protected]>
Sent: Thursday, January 17, 2002 12:45 AM
Subject: fxload putting code at a wrong place

Quoted 13 lines

High !

I just bought an Ez USB development kit and tried to play with it
using fxload. The new merging algorithm seems to forget to initialize data_addr.

Attached is a small patch that, I think, fixes it.

Regards,

Signature · 1 line
Matthieu Lochegnies

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel