From 44a5b43d16181a2031d95d08e75e4bfa1d3a69f9 Mon Sep 17 00:00:00 2001 From: geogrego Date: Thu, 13 Nov 2025 16:48:05 +0800 Subject: [PATCH] chore: fix a large number of spelling issues Signed-off-by: geogrego --- ledger_device_sdk/src/io_legacy.rs | 2 +- ledger_device_sdk/src/nvm.rs | 10 +++++----- ledger_secure_sdk_sys/link.ld | 4 ++-- ledger_secure_sdk_sys/src/c/src.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ledger_device_sdk/src/io_legacy.rs b/ledger_device_sdk/src/io_legacy.rs index 80aa84a5..fee1668b 100644 --- a/ledger_device_sdk/src/io_legacy.rs +++ b/ledger_device_sdk/src/io_legacy.rs @@ -257,7 +257,7 @@ impl Comm { } /// Send the currently held APDU - // This is private. Users should call reply to set the satus word and + // This is private. Users should call reply to set the status word and // transmit the response. fn apdu_send(&mut self) { #[cfg(any( diff --git a/ledger_device_sdk/src/nvm.rs b/ledger_device_sdk/src/nvm.rs index c71b2b87..f53f8ad7 100644 --- a/ledger_device_sdk/src/nvm.rs +++ b/ledger_device_sdk/src/nvm.rs @@ -73,7 +73,7 @@ pub trait SingleStorage { /// unfinished write detection in SafeStorage and atomic operations in /// AtomicStorage). /// -/// Warning: this wrapper does not provide any garantee about update atomicity. +/// Warning: this wrapper does not provide any guarantee about update atomicity. #[repr(align(64))] #[derive(Copy, Clone)] pub struct AlignedStorage { @@ -99,7 +99,7 @@ impl SingleStorage for AlignedStorage { &self.value } - /// Update the value by writting to the NVM memory. + /// Update the value by writing to the NVM memory. /// Warning: this can be vulnerable to tearing - leading to partial write. fn update(&mut self, value: &T) { unsafe { @@ -114,7 +114,7 @@ impl SingleStorage for AlignedStorage { } /// Just a non-zero magic to mark a storage as valid, when the update procedure -/// has not been interupted. Any value excepted 0 and 0xff may work. +/// has not been interrupted. Any value excepted 0 and 0xff may work. const STORAGE_VALID: u8 = 0xa5; /// Non-Volatile data storage, with a flag to detect corruption if the update @@ -175,7 +175,7 @@ macro_rules! atomic_storage { pub struct AtomicStorage { // We must keep the storage B in another page, so when we update the // storage A, erasing the page of A won't modify the storage for B. - // This is currently garanteed by the alignment of AlignedStorage. + // This is currently guaranteed by the alignment of AlignedStorage. storage_a: SafeStorage, storage_b: SafeStorage, // We also accept situations where both storages are marked as valid, which // can happen with tearing. This is not a problem, and we consider the first @@ -240,7 +240,7 @@ where } } - /// Update the value by writting to the NVM memory. + /// Update the value by writing to the NVM memory. /// Warning: this can be vulnerable to tearing - leading to partial write. fn update(&mut self, value: &T) { match self.which() { diff --git a/ledger_secure_sdk_sys/link.ld b/ledger_secure_sdk_sys/link.ld index edbcf400..5e84950f 100644 --- a/ledger_secure_sdk_sys/link.ld +++ b/ledger_secure_sdk_sys/link.ld @@ -26,7 +26,7 @@ SECTIONS _etext = .; } > FLASH :flash0 - /* Relocations, read only, no relocations aginst the relocations themselves + /* Relocations, read only, no relocations against the relocations themselves needed! */ _reloc_size = SIZEOF(.rel.rodata) + SIZEOF(.rel.data) + SIZEOF(.rel.nvm_data); .rel_flash : ALIGN(PAGE_SIZE) @@ -48,7 +48,7 @@ SECTIONS relocations are needed. (So not read-only completely.) */ .rodata : ALIGN(PAGE_SIZE) { - /* Moved here from .text so we can permantly apply relocations to it with + /* Moved here from .text so we can permanently apply relocations to it with nvm_write() */ . = ALIGN(PAGE_SIZE); _rodata = .; diff --git a/ledger_secure_sdk_sys/src/c/src.c b/ledger_secure_sdk_sys/src/c/src.c index ee2518cd..6209b8e4 100644 --- a/ledger_secure_sdk_sys/src/c/src.c +++ b/ledger_secure_sdk_sys/src/c/src.c @@ -112,7 +112,7 @@ void link_pass( PRINTHEXC("First reloc: ", reloc_start->r_offset); // Loop over the rodata entries - we could loop over the - // correct seciton, but this also works. + // correct section, but this also works. for (Elf32_Rel* reloc = reloc_start; reloc < reloc_end; reloc++) { // This is the (absolute) elf *load* address of the relocation. link_addr_t abs_offset = reloc->r_offset;