this resolves comments from @xobs' code review

This commit is contained in:
bunnie 2024-04-09 18:23:09 +08:00
parent 336e47eabe
commit 4ace363abc
3 changed files with 3 additions and 7 deletions

View file

@ -1035,11 +1035,7 @@ impl Spim {
}
while words_sent < total_words {
// determine the valid length of data we could send
let tx_len = if (total_words - words_sent) >= self.tx_buf_len_bytes as usize {
self.tx_buf_len_bytes
} else {
total_words - words_sent
};
let tx_len = (total_words - words_sent).min(self.tx_buf_len_bytes);
// setup the command list for data to send
let cmd_list = [SpimCmd::TxData(
self.mode,

View file

@ -134,7 +134,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32, fs_prehash: [u8; 64]) -
cfg.swap_hal = SwapHal::new(&cfg);
read_swap_config(&mut cfg);
#[cfg(feature = "resume")]
println!(
compile_error!(
"WARNING WARNING WARNING: swap and resume selected - this is not a valid configuration because\
the stack overlaps into the 'clean suspend' marker with swap. This needs to be fixed if resume is desired with swap."
);

View file

@ -431,7 +431,7 @@ fn main() {
}
if let Some(init_paths) = matches.values_of("inis") {
if let Some(ref mut sargs) = swap_args {
if let Some(sargs) = &mut swap_args {
for init_path in init_paths {
let program_name = std::path::Path::new(init_path);
process_names.set(