Edward O'Callaghan submitted this change.
flashrom_tester: update syntax for --wp-range
TEST=cargo test
Signed-off-by: Daniel Campello <campello@chromium.org>
Change-Id: If17a40fba1f7d41e09e0163b353d1602c215c8db
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52876
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M util/flashrom_tester/flashrom/src/cmd.rs
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/util/flashrom_tester/flashrom/src/cmd.rs b/util/flashrom_tester/flashrom/src/cmd.rs
index 3fd2ac0..8775ed4 100644
--- a/util/flashrom_tester/flashrom/src/cmd.rs
+++ b/util/flashrom_tester/flashrom/src/cmd.rs
@@ -90,8 +90,7 @@
if opts.wp_opt.range.is_some() {
let (x0, x1) = opts.wp_opt.range.unwrap();
params.push("--wp-range".to_string());
- params.push(hex_string(x0));
- params.push(hex_string(x1));
+ params.push(hex_range_string(x0, x1));
}
if opts.wp_opt.status {
params.push("--wp-status".to_string());
@@ -209,8 +208,8 @@
Ok((output.stdout, output.stderr))
}
-fn hex_string(v: i64) -> String {
- format!("{:#08X}", v).to_string()
+fn hex_range_string(s: i64, l: i64) -> String {
+ format!("{:#08X},{:#08X}", s, l).to_string()
}
#[cfg(test)]
@@ -237,7 +236,7 @@
status: true,
..Default::default()
},
- &["--wp-range", "0x000000", "0x0004D2", "--wp-status"],
+ &["--wp-range", "0x000000,0x0004D2", "--wp-status"],
);
test_wp_opt(
WPOpt {
To view, visit change 52876. To unsubscribe, or for help writing mail filters, visit settings.