From 33d717d3a007989a88ec9c4abebf563fabd05760 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 17 Dec 2024 15:43:26 +0800 Subject: [PATCH] tools/parsetrace.py: fix typo lenght -> length Signed-off-by: chao an --- arch/arm/src/imxrt/hardware/imxrt_adc_etc.h | 2 +- arch/arm/src/samv7/sam_xdmac.c | 2 +- arch/arm/src/samv7/sam_xdmac.h | 2 +- arch/risc-v/src/common/espressif/esp_ws2812.c | 2 +- arch/xtensa/src/common/espressif/esp_ws2812.c | 2 +- tools/parsetrace.py | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm/src/imxrt/hardware/imxrt_adc_etc.h b/arch/arm/src/imxrt/hardware/imxrt_adc_etc.h index 2bc532bfdb..2dfe3854d8 100644 --- a/arch/arm/src/imxrt/hardware/imxrt_adc_etc.h +++ b/arch/arm/src/imxrt/hardware/imxrt_adc_etc.h @@ -142,7 +142,7 @@ /* Bits 1-3: Reserved */ #define ADC_ETC_TRIG_CTRL_TRIG_MODE (1 << 4) /* Bit 4: Sotware trigger select */ /* Bits 5-7: Reserved */ -#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT (8) /* Bits 8-11: TRIG chain lenght to the ADC */ +#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT (8) /* Bits 8-11: TRIG chain length to the ADC */ #define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK (0x7 << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT) #define ADC_ETC_TRIG_CTRL_TRIG_CHAIN(n) (((uint32_t)(n) << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT) & ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK) /* Bit 11: Reserved */ diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index b170690df0..7237a6172c 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -1915,7 +1915,7 @@ int sam_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, * maddr - array of memory addresses (i.e. destination addresses) * paddr - peripheral address (i.e. source address) * nbytes - number of bytes to transfer - * ndescrs - number of descriptors (i.e. the lenght of descr array) + * ndescrs - number of descriptors (i.e. the length of descr array) * ****************************************************************************/ diff --git a/arch/arm/src/samv7/sam_xdmac.h b/arch/arm/src/samv7/sam_xdmac.h index 21830f7801..ee9fb51655 100644 --- a/arch/arm/src/samv7/sam_xdmac.h +++ b/arch/arm/src/samv7/sam_xdmac.h @@ -350,7 +350,7 @@ int sam_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, * maddr - array of memory addresses (i.e. destination addresses) * paddr - peripheral address (i.e. source address) * nbytes - number of bytes to transfer - * ndescrs - number of descriptors (i.e. the lenght of descr array) + * ndescrs - number of descriptors (i.e. the length of descr array) * ****************************************************************************/ diff --git a/arch/risc-v/src/common/espressif/esp_ws2812.c b/arch/risc-v/src/common/espressif/esp_ws2812.c index 4f50efade9..c94261e5ad 100644 --- a/arch/risc-v/src/common/espressif/esp_ws2812.c +++ b/arch/risc-v/src/common/espressif/esp_ws2812.c @@ -464,7 +464,7 @@ static ssize_t esp_write(struct file *filep, const char *data, size_t len) if (len > 0) { - /* Check if the lenght to be updated, considering the current position, + /* Check if the length to be updated, considering the current position, * is valid. The number of LEDs to be updated should, starting from the * current offset should be less than the LED strip total length. */ diff --git a/arch/xtensa/src/common/espressif/esp_ws2812.c b/arch/xtensa/src/common/espressif/esp_ws2812.c index f0e5dd1853..10a25428fc 100644 --- a/arch/xtensa/src/common/espressif/esp_ws2812.c +++ b/arch/xtensa/src/common/espressif/esp_ws2812.c @@ -464,7 +464,7 @@ static ssize_t esp_write(struct file *filep, const char *data, size_t len) if (len > 0) { - /* Check if the lenght to be updated, considering the current position, + /* Check if the length to be updated, considering the current position, * is valid. The number of LEDs to be updated should, starting from the * current offset should be less than the LED strip total length. */ diff --git a/tools/parsetrace.py b/tools/parsetrace.py index b4c431aff8..897fffd021 100755 --- a/tools/parsetrace.py +++ b/tools/parsetrace.py @@ -484,14 +484,14 @@ class TraceDecoder(SymbolTables): return "%s", length, fmt % value def extract_string(self, fmt, data): - lenght = 0 + length = 0 if fmt == "%.*s": - lenght = int.from_bytes( + length = int.from_bytes( data[:4], byteorder=self.elfinfo["byteorder"], signed=True ) data = data[4:] else: - lenght = 0 + length = 0 try: string = data.split(b"\x00")[0].decode("utf-8") @@ -501,17 +501,17 @@ class TraceDecoder(SymbolTables): data[:size], byteorder=self.elfinfo["byteorder"], signed=False ) string = f"<<0x{address}>>" - lenght += size + length += size else: - lenght += len(string) + 1 + length += len(string) + 1 except Exception: size = 4 if self.typeinfo["size_t"] == "uint32" else 8 address = int.from_bytes( data[:size], byteorder=self.elfinfo["byteorder"], signed=False ) string = f"<<0x{address}>>" - lenght += size - return "%s", lenght, string + length += size + return "%s", length, string def extract_point(self, fmt, data): length = 4 if self.typeinfo["size_t"] == "int32" else 8