Skip to content

Commit 16bf7e3

Browse files
kiram9JohnAZoidberg
authored andcommitted
fw16 - round up chunk calculation
found that when writing the GPU EEPROM descriptor depending on the length of the descriptor, the end would be missing Signed-off-by: Kieran Levin <ktl@frame.work>
1 parent be8932f commit 16bf7e3

File tree

1 file changed

+1
-1
lines changed
  • framework_lib/src/chromium_ec

1 file changed

+1
-1
lines changed

framework_lib/src/chromium_ec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ impl CrosEc {
14511451
// Need to program the EEPROM 32 bytes at a time.
14521452
let chunk_size = 32;
14531453

1454-
let chunks = data.len() / chunk_size;
1454+
let chunks = data.len().div_ceil(chunk_size);
14551455
let mut return_val: EcResult<()> = Ok(());
14561456
for chunk_no in 0..chunks {
14571457
let offset = chunk_no * chunk_size;

0 commit comments

Comments
 (0)