[LinuxBIOS] flashrom: patch for jedec.c
ron minnich
rminnich at gmail.com
Tue Nov 21 03:48:18 CET 2006
this part is unnecessarily complex, and will miss problems that might
occur (weird ones but )...
+ dst = d;
+ src = s;
+ ok = 1;
+ for (i = 0; i < page_size; i++) {
+ if (*src != 0xFF)
+ if ( *dst != *src )
+ {
+ ok = 0;
+ break;
+ }
+ dst++;
+ src++;
+ }
+
+ if (!ok && tried++ < 0x10) {
+ start_index = i;
+ goto retry;
+ }
+ if (!ok) {
+ fprintf( stderr, " page %d failed!\n", (d-bios)/page_size );
+ }
how about this?
+ dst = d;
+ src = s;
+ ok = 1;
+ for (i = 0; i < page_size; i++) {
+
+ if ( *dst != *src )
+ {
+ ok = 0;
+ break;
+ }
+ dst++;
+ src++;
+ }
+
+ if (!ok && tried++ < 0x10) {
+ start_index = i;
+ goto retry;
+ }
+ if (!ok) {
+ fprintf( stderr, " page %d failed!\n", (d-bios)/page_size );
+ }
More information about the coreboot
mailing list