diff options
Diffstat (limited to 'util/flashrom_tester')
-rw-r--r-- | util/flashrom_tester/flashrom/src/cmd.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/util/flashrom_tester/flashrom/src/cmd.rs b/util/flashrom_tester/flashrom/src/cmd.rs index 3fd2ac04..8775ed44 100644 --- a/util/flashrom_tester/flashrom/src/cmd.rs +++ b/util/flashrom_tester/flashrom/src/cmd.rs @@ -90,8 +90,7 @@ fn flashrom_decode_opts(opts: FlashromOpt) -> Vec<String> { 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 @@ fn dut_ctrl(args: &[&str]) -> Result<(Vec<u8>, Vec<u8>), FlashromError> { 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 @@ mod tests { status: true, ..Default::default() }, - &["--wp-range", "0x000000", "0x0004D2", "--wp-status"], + &["--wp-range", "0x000000,0x0004D2", "--wp-status"], ); test_wp_opt( WPOpt { |