Remove redundant align/erased_val usage
A new align() function was added to SimFlash, and most functions that
were using/receiving align or erased_val parameters that had access to a
Flash trait were cleaned up so that they get the parameters directly
from the Flash device.
This will make it easier to extend for multiple Flash devices since
parameters should depend on the device in use.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/simflash/src/lib.rs b/sim/simflash/src/lib.rs
index 9523a4f..c628ec1 100644
--- a/sim/simflash/src/lib.rs
+++ b/sim/simflash/src/lib.rs
@@ -46,6 +46,7 @@
fn sector_iter(&self) -> SectorIter;
fn device_size(&self) -> usize;
+ fn align(&self) -> usize;
fn erased_val(&self) -> u8;
}
@@ -239,6 +240,10 @@
self.data.len()
}
+ fn align(&self) -> usize {
+ self.align
+ }
+
fn erased_val(&self) -> u8 {
self.erased_val
}