Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Evan Lojewski
ast2050-flashrom
Commits
789ad3db
Commit
789ad3db
authored
21 years ago
by
Ollie Lho
Browse files
Options
Download
Email Patches
Plain Diff
Fix stupid i++ evalution order bug
Corresponding to flashrom svn r9 and coreboot v2 svn r1435.
parent
cf29de87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
flash_rom.c
flash_rom.c
+8
-4
No files found.
flash_rom.c
View file @
789ad3db
...
...
@@ -141,7 +141,7 @@ int verify_flash (struct flashchip * flash, char * buf, int verbose)
volatile
char
*
bios
=
flash
->
virt_addr
;
printf
(
"Verifying address: "
);
while
(
i
++
<
total_size
)
{
while
(
i
<
total_size
)
{
if
(
verbose
)
printf
(
"0x%08x"
,
i
);
if
(
*
(
bios
+
i
)
!=
*
(
buf
+
i
))
{
...
...
@@ -150,6 +150,7 @@ int verify_flash (struct flashchip * flash, char * buf, int verbose)
}
if
(
verbose
)
printf
(
"
\b\b\b\b\b\b\b\b\b\b
"
);
i
++
}
if
(
verbose
)
printf
(
"
\n
"
);
...
...
@@ -178,12 +179,12 @@ int main (int argc, char * argv[])
FILE
*
image
;
struct
flashchip
*
flash
;
int
opt
;
int
read_it
=
0
,
write_it
=
0
,
verify_it
=
0
;
int
read_it
=
0
,
write_it
=
0
,
verify_it
=
0
,
verbose
=
0
;
char
*
filename
=
NULL
;
setbuf
(
stdout
,
NULL
);
while
((
opt
=
getopt
(
argc
,
argv
,
"rwvc:"
))
!=
EOF
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"rwv
V
c:"
))
!=
EOF
)
{
switch
(
opt
)
{
case
'r'
:
read_it
=
1
;
...
...
@@ -197,6 +198,9 @@ int main (int argc, char * argv[])
case
'c'
:
chip_to_probe
=
strdup
(
optarg
);
break
;
case
'V'
:
verbose
=
1
;
break
;
default:
usage
(
argv
[
0
]);
break
;
...
...
@@ -257,6 +261,6 @@ int main (int argc, char * argv[])
if
(
write_it
||
(
!
read_it
&&
!
verify_it
))
flash
->
write
(
flash
,
buf
);
if
(
verify_it
)
verify_flash
(
flash
,
buf
,
/*
verbose
= */
0
);
verify_flash
(
flash
,
buf
,
verbose
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment