diff --git a/compileopts/target.go b/compileopts/target.go index 66f44b7ccf..da91cfa4ff 100644 --- a/compileopts/target.go +++ b/compileopts/target.go @@ -26,7 +26,7 @@ type TargetSpec struct { Inherits []string `json:"inherits,omitempty"` Triple string `json:"llvm-target,omitempty"` CPU string `json:"cpu,omitempty"` - ABI string `json:"target-abi,omitempty"` // rougly equivalent to -mabi= flag + ABI string `json:"target-abi,omitempty"` // roughly equivalent to -mabi= flag Features string `json:"features,omitempty"` GOOS string `json:"goos,omitempty"` GOARCH string `json:"goarch,omitempty"` diff --git a/compiler/compiler.go b/compiler/compiler.go index 63fc214c99..0ae32cc94c 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -2181,7 +2181,7 @@ func (b *builder) createExpr(expr ssa.Value) (llvm.Value, error) { return llvm.Value{}, b.makeError(expr.Pos(), "todo: indexaddr: "+ptrTyp.String()) } - // Make sure index is at least the size of uintptr becuase getelementptr + // Make sure index is at least the size of uintptr because getelementptr // assumes index is a signed integer. index = b.extendInteger(index, expr.Index.Type(), b.uintptrType) @@ -2557,7 +2557,7 @@ func (b *builder) createBinOp(op token.Token, typ, ytyp types.Type, x, y llvm.Va sizeY := b.targetData.TypeAllocSize(y.Type()) // Check if the shift is bigger than the bit-width of the shifted value. - // This is UB in LLVM, so it needs to be handled seperately. + // This is UB in LLVM, so it needs to be handled separately. // The Go spec indirectly defines the result as 0. // Negative shifts are handled earlier, so we can treat y as unsigned. overshifted := b.CreateICmp(llvm.IntUGE, y, llvm.ConstInt(y.Type(), 8*sizeX, false), "shift.overflow") diff --git a/compiler/llvmutil/llvm.go b/compiler/llvmutil/llvm.go index 5490106d84..d4ceee3fbc 100644 --- a/compiler/llvmutil/llvm.go +++ b/compiler/llvmutil/llvm.go @@ -1,5 +1,5 @@ // Package llvmutil contains utility functions used across multiple compiler -// packages. For example, they may be used by both the compiler pacakge and +// packages. For example, they may be used by both the compiler package and // transformation packages. // // Normally, utility packages are avoided. However, in this case, the utility @@ -28,7 +28,7 @@ func CreateEntryBlockAlloca(builder llvm.Builder, t llvm.Type, name string) llvm } // CreateTemporaryAlloca creates a new alloca in the entry block and adds -// lifetime start infromation in the IR signalling that the alloca won't be used +// lifetime start information in the IR signalling that the alloca won't be used // before this point. // // This is useful for creating temporary allocas for intrinsics. Don't forget to diff --git a/loader/goroot.go b/loader/goroot.go index ea2f705dc9..c7341fc7fd 100644 --- a/loader/goroot.go +++ b/loader/goroot.go @@ -214,7 +214,7 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool) return merges, nil } -// needsSyscallPackage returns whether the syscall package should be overriden +// needsSyscallPackage returns whether the syscall package should be overridden // with the TinyGo version. This is the case on some targets. func needsSyscallPackage(buildTags []string) bool { for _, tag := range buildTags { diff --git a/loader/loader.go b/loader/loader.go index e66812a8e4..a874291a6a 100644 --- a/loader/loader.go +++ b/loader/loader.go @@ -430,7 +430,7 @@ func (p *Package) parseFiles() ([]*ast.File, error) { var files []*ast.File var fileErrs []error - // Parse all files (incuding CgoFiles). + // Parse all files (including CgoFiles). parseFile := func(file string) { if !filepath.IsAbs(file) { file = filepath.Join(p.Dir, file) diff --git a/src/internal/bytealg/bytealg.go b/src/internal/bytealg/bytealg.go index eb5fcbfbd4..4cf442e8e6 100644 --- a/src/internal/bytealg/bytealg.go +++ b/src/internal/bytealg/bytealg.go @@ -57,7 +57,7 @@ func Count(b []byte, c byte) int { // Count the number of instances of a byte in a string. func CountString(s string, c byte) int { // Use a simple implementation, as there is no intrinsic that does this like we want. - // Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be seperate from Count. + // Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be separate from Count. n := 0 for i := 0; i < len(s); i++ { if s[i] == c { @@ -216,7 +216,7 @@ func HashStrRev[T string | []byte](sep T) (uint32, uint32) { } // IndexRabinKarpBytes uses the Rabin-Karp search algorithm to return the index of the -// first occurence of substr in s, or -1 if not present. +// first occurrence of substr in s, or -1 if not present. // // This function was removed in Go 1.22. func IndexRabinKarpBytes(s, sep []byte) int { diff --git a/src/internal/task/task_stack.go b/src/internal/task/task_stack.go index 81e0f9ad76..f566de041b 100644 --- a/src/internal/task/task_stack.go +++ b/src/internal/task/task_stack.go @@ -44,7 +44,7 @@ func Current() *Task { // This function may only be called when running on a goroutine stack, not when running on the system stack or in an interrupt. func Pause() { // Check whether the canary (the lowest address of the stack) is still - // valid. If it is not, a stack overflow has occured. + // valid. If it is not, a stack overflow has occurred. if *currentTask.state.canaryPtr != stackCanary { runtimePanic("goroutine stack overflow") } diff --git a/src/machine/board_nano-33-ble.go b/src/machine/board_nano-33-ble.go index 911be0add5..758d5434e1 100644 --- a/src/machine/board_nano-33-ble.go +++ b/src/machine/board_nano-33-ble.go @@ -26,7 +26,7 @@ // SoftDevice (s140v7) must be flashed first to enable use of bluetooth on this board. // See https://github.com/tinygo-org/bluetooth // -// SoftDevice overwrites original bootloader and flashing method described above is not avalable anymore. +// SoftDevice overwrites original bootloader and flashing method described above is not available anymore. // Instead, please use debug probe and flash your code with "nano-33-ble-s140v7" target. package machine diff --git a/src/machine/machine_atsamd21.go b/src/machine/machine_atsamd21.go index 34e2f11edc..b6cd850628 100644 --- a/src/machine/machine_atsamd21.go +++ b/src/machine/machine_atsamd21.go @@ -1304,7 +1304,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(spi.Bus.DATA.Get()), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // @@ -1459,7 +1459,7 @@ func (tcc *TCC) Configure(config PWMConfig) error { for tcc.timer().SYNCBUSY.Get() != 0 { } - // Return any error that might have occured in the tcc.setPeriod call. + // Return any error that might have occurred in the tcc.setPeriod call. return err } @@ -1606,7 +1606,7 @@ func (tcc *TCC) Counter() uint32 { return tcc.timer().COUNT.Get() } -// Some constans to make pinTimerMapping below easier to read. +// Some constants to make pinTimerMapping below easier to read. const ( pinTCC0 = 1 pinTCC1 = 2 @@ -1759,7 +1759,7 @@ func (tcc *TCC) Set(channel uint8, value uint32) { } } -// EnterBootloader should perform a system reset in preperation +// EnterBootloader should perform a system reset in preparation // to switch to the bootloader to flash new firmware. func EnterBootloader() { arm.DisableInterrupts() diff --git a/src/machine/machine_atsamd51.go b/src/machine/machine_atsamd51.go index 0d786dba72..d770417419 100644 --- a/src/machine/machine_atsamd51.go +++ b/src/machine/machine_atsamd51.go @@ -1587,7 +1587,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(spi.Bus.DATA.Get()), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // @@ -1720,7 +1720,7 @@ func (tcc *TCC) Configure(config PWMConfig) error { for tcc.timer().SYNCBUSY.Get() != 0 { } - // Return any error that might have occured in the tcc.setPeriod call. + // Return any error that might have occurred in the tcc.setPeriod call. return err } diff --git a/src/machine/machine_atsame5x_can.go b/src/machine/machine_atsame5x_can.go index b404bdaa68..498646980d 100644 --- a/src/machine/machine_atsame5x_can.go +++ b/src/machine/machine_atsame5x_can.go @@ -155,7 +155,7 @@ func (can *CAN) Configure(config CANConfig) error { } // Callbacks to be called for CAN.SetInterrupt(). Wre're using the magic -// constant 2 and 32 here beacuse th SAM E51/E54 has 2 CAN and 32 interrupt +// constant 2 and 32 here because the SAM E51/E54 has 2 CAN and 32 interrupt // sources. var ( canInstances [2]*CAN diff --git a/src/machine/machine_esp32.go b/src/machine/machine_esp32.go index 0bc17b4416..d6f6599288 100644 --- a/src/machine/machine_esp32.go +++ b/src/machine/machine_esp32.go @@ -460,7 +460,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(spi.Bus.W0.Get()), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // This is accomplished by sending zero bits if r is bigger than w or discarding // the incoming data if w is bigger than r. diff --git a/src/machine/machine_esp32c3.go b/src/machine/machine_esp32c3.go index 2745f7af21..b1ad0bc2fc 100644 --- a/src/machine/machine_esp32c3.go +++ b/src/machine/machine_esp32c3.go @@ -312,7 +312,7 @@ func (uart *UART) configure(config UARTConfig, regs registerSet) error { initUARTClock(uart.Bus, regs) - // - disbale TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration + // - disable TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration uart.Bus.SetCLK_CONF_TX_SCLK_EN(0) uart.Bus.SetCLK_CONF_RX_SCLK_EN(0) diff --git a/src/machine/machine_esp32c3_spi.go b/src/machine/machine_esp32c3_spi.go index 5e90c9f5bb..2fb8abc200 100644 --- a/src/machine/machine_esp32c3_spi.go +++ b/src/machine/machine_esp32c3_spi.go @@ -234,7 +234,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(spi.Bus.GetW0()), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // This is accomplished by sending zero bits if r is bigger than w or discarding // the incoming data if w is bigger than r. diff --git a/src/machine/machine_generic.go b/src/machine/machine_generic.go index e7d513ad1e..ec03a03051 100644 --- a/src/machine/machine_generic.go +++ b/src/machine/machine_generic.go @@ -66,7 +66,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return spiTransfer(spi.Bus, w), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // diff --git a/src/machine/machine_nrf.go b/src/machine/machine_nrf.go index cc68c1d916..99c49d3cab 100644 --- a/src/machine/machine_nrf.go +++ b/src/machine/machine_nrf.go @@ -108,7 +108,7 @@ func (p Pin) Get() bool { func (p Pin) SetInterrupt(change PinChange, callback func(Pin)) error { // Some variables to easily check whether a channel was already configured // as an event channel for the given pin. - // This is not just an optimization, this is requred: the datasheet says + // This is not just an optimization, this is required: the datasheet says // that configuring more than one channel for a given pin results in // unpredictable behavior. expectedConfigMask := uint32(nrf.GPIOTE_CONFIG_MODE_Msk | nrf.GPIOTE_CONFIG_PSEL_Msk) diff --git a/src/machine/machine_nrf51.go b/src/machine/machine_nrf51.go index ae6ff61a84..8d27e6fc55 100644 --- a/src/machine/machine_nrf51.go +++ b/src/machine/machine_nrf51.go @@ -133,7 +133,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(r), nil } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // diff --git a/src/machine/machine_nrf52xxx.go b/src/machine/machine_nrf52xxx.go index 04fbaaf9dc..ee035b74d6 100644 --- a/src/machine/machine_nrf52xxx.go +++ b/src/machine/machine_nrf52xxx.go @@ -277,7 +277,7 @@ func (spi SPI) Transfer(w byte) (byte, error) { return buf[0], err } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous // write/read interface, there must always be the same number of bytes written // as bytes read. Therefore, if the number of bytes don't match it will be // padded until they fit: if len(w) > len(r) the extra bytes received will be diff --git a/src/machine/machine_rp2040_i2c.go b/src/machine/machine_rp2040_i2c.go index d51e14b8f2..1b66a86876 100644 --- a/src/machine/machine_rp2040_i2c.go +++ b/src/machine/machine_rp2040_i2c.go @@ -348,7 +348,7 @@ func (i2c *I2C) tx(addr uint8, tx, rx []byte, timeout_us uint64) (err error) { } if abort || last { // If the transaction was aborted or if it completed - // successfully wait until the STOP condition has occured. + // successfully wait until the STOP condition has occurred. // TODO Could there be an abort while waiting for the STOP // condition here? If so, additional code would be needed here diff --git a/src/machine/machine_rp2040_spi.go b/src/machine/machine_rp2040_spi.go index cb60fdbcb0..dbb063cb30 100644 --- a/src/machine/machine_rp2040_spi.go +++ b/src/machine/machine_rp2040_spi.go @@ -48,7 +48,7 @@ type SPI struct { Bus *rp.SPI0_Type } -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // diff --git a/src/machine/machine_stm32l5x2.go b/src/machine/machine_stm32l5x2.go index 2fb3a0d638..d439b8fd93 100644 --- a/src/machine/machine_stm32l5x2.go +++ b/src/machine/machine_stm32l5x2.go @@ -23,7 +23,7 @@ const APB2_TIM_FREQ = 110e6 // 110MHz // Configure the UART. func (uart *UART) configurePins(config UARTConfig) { if config.RX.getPort() == stm32.GPIOG || config.TX.getPort() == stm32.GPIOG { - // Enable VDDIO2 power supply, which is an independant power supply for the PGx pins + // Enable VDDIO2 power supply, which is an independent power supply for the PGx pins stm32.PWR.CR2.SetBits(stm32.PWR_CR2_IOSV) } diff --git a/src/machine/spi_tx.go b/src/machine/spi_tx.go index bb6305fe73..67076b2bdf 100644 --- a/src/machine/spi_tx.go +++ b/src/machine/spi_tx.go @@ -5,7 +5,7 @@ package machine -// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read +// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read // interface, there must always be the same number of bytes written as bytes read. // The Tx method knows about this, and offers a few different ways of calling it. // diff --git a/src/os/filesystem.go b/src/os/filesystem.go index f38b22660d..8b44367075 100644 --- a/src/os/filesystem.go +++ b/src/os/filesystem.go @@ -30,7 +30,7 @@ type Filesystem interface { // OpenFile opens the named file. OpenFile(name string, flag int, perm FileMode) (uintptr, error) - // Mkdir creates a new directoy with the specified permission (before + // Mkdir creates a new directory with the specified permission (before // umask). Some filesystems may not support directories or permissions. Mkdir(name string, perm FileMode) error diff --git a/src/os/seek_unix_bad.go b/src/os/seek_unix_bad.go index 1f09426aec..4243ced642 100644 --- a/src/os/seek_unix_bad.go +++ b/src/os/seek_unix_bad.go @@ -11,7 +11,7 @@ import ( // In particular, on i386 and arm, the function syscall.seek is missing, breaking syscall.Seek. // This in turn causes os.(*File).Seek, time, io/fs, and path/filepath to fail to link. // -// To temporarly let all the above at least link, provide a stub for syscall.seek. +// To temporarily let all the above at least link, provide a stub for syscall.seek. // This belongs in syscall, but on linux, we use upstream's syscall. // Remove once we support Go Assembly. // TODO: make this a non-stub, and thus fix the whole problem? diff --git a/src/runtime/chan.go b/src/runtime/chan.go index 6253722467..532b31cc59 100644 --- a/src/runtime/chan.go +++ b/src/runtime/chan.go @@ -76,7 +76,7 @@ func (b *channelBlockedList) remove(old *channelBlockedList) *channelBlockedList return b } -// detatch removes all other channel operations that are part of the same select statement. +// detach removes all other channel operations that are part of the same select statement. // If the input is not part of a select statement, this is a no-op. // This must be called before resuming any task blocked on a channel operation in order to ensure that it is not placed on the runqueue twice. func (b *channelBlockedList) detach() { @@ -88,7 +88,7 @@ func (b *channelBlockedList) detach() { // cancel all other channel operations that are part of this select statement switch { case &b.allSelectOps[i] == b: - // This entry is the one that was already detatched. + // This entry is the one that was already detached. continue case v.t == nil: // This entry is not used (nil channel). diff --git a/src/runtime/gc_blocks.go b/src/runtime/gc_blocks.go index 02a8277300..7db6b7a1cf 100644 --- a/src/runtime/gc_blocks.go +++ b/src/runtime/gc_blocks.go @@ -410,7 +410,7 @@ func GC() { runGC() } -// runGC performs a garbage colleciton cycle. It is the internal implementation +// runGC performs a garbage collection cycle. It is the internal implementation // of the runtime.GC() function. The difference is that it returns the number of // free bytes in the heap after the GC is finished. func runGC() (freeBytes uintptr) { @@ -424,7 +424,7 @@ func runGC() (freeBytes uintptr) { if baremetal && hasScheduler { // Channel operations in interrupts may move task pointers around while we are marking. - // Therefore we need to scan the runqueue seperately. + // Therefore we need to scan the runqueue separately. var markedTaskQueue task.Queue runqueueScan: for !runqueue.Empty() { diff --git a/src/runtime/gc_precise.go b/src/runtime/gc_precise.go index 4c7463b8ec..aa716585c8 100644 --- a/src/runtime/gc_precise.go +++ b/src/runtime/gc_precise.go @@ -7,7 +7,7 @@ // however use a bit more RAM to store the layout of each object. // // The pointer/non-pointer information for objects is stored in the first word -// of the object. It is described below but in essense it contains a bitstring +// of the object. It is described below but in essence it contains a bitstring // of a particular size. This size does not indicate the size of the object: // instead the allocated object is a multiple of the bitstring size. This is so // that arrays and slices can store the size of the object efficiently. The diff --git a/src/runtime/interrupt/interrupt.go b/src/runtime/interrupt/interrupt.go index a8cf6f4e98..e0376a52f9 100644 --- a/src/runtime/interrupt/interrupt.go +++ b/src/runtime/interrupt/interrupt.go @@ -26,7 +26,7 @@ func New(id int, handler func(Interrupt)) Interrupt // and use that in an Interrupt object. That way the compiler will be able to // optimize away all interrupt handles that are never used in a program. // This system only works when interrupts need to be enabled before use and this -// is done only through calling Enable() on this object. If interrups cannot +// is done only through calling Enable() on this object. If interrupts cannot // individually be enabled/disabled, the compiler should create a pseudo-call // (like runtime/interrupt.use()) that keeps the interrupt alive. type handle struct { diff --git a/src/runtime/interrupt/interrupt_esp32c3.go b/src/runtime/interrupt/interrupt_esp32c3.go index 7d9be3937e..b1a5bb1b3c 100644 --- a/src/runtime/interrupt/interrupt_esp32c3.go +++ b/src/runtime/interrupt/interrupt_esp32c3.go @@ -169,7 +169,7 @@ func handleInterrupt() { // save MSTATUS & MEPC, which could be overwritten by another CPU interrupt mstatus := riscv.MSTATUS.Get() mepc := riscv.MEPC.Get() - // Useing threshold to temporary disable this interrupts. + // Using threshold to temporary disable this interrupts. // FYI: using CPU interrupt enable bit make runtime to loose interrupts. reg := (*volatile.Register32)(unsafe.Add(unsafe.Pointer(&esp.INTERRUPT_CORE0.CPU_INT_PRI_0), interruptNumber*4)) thresholdSave := reg.Get() diff --git a/src/runtime/os_darwin.go b/src/runtime/os_darwin.go index d9894bc1a4..eeb192dda8 100644 --- a/src/runtime/os_darwin.go +++ b/src/runtime/os_darwin.go @@ -107,7 +107,7 @@ func findGlobals(found func(start, end uintptr)) { } } - // Move on to the next load command (wich may or may not be a + // Move on to the next load command (which may or may not be a // LC_SEGMENT_64). cmd = (*segmentLoadCommand)(unsafe.Add(unsafe.Pointer(cmd), cmd.cmdsize)) } diff --git a/src/runtime/runtime_atsamd21.go b/src/runtime/runtime_atsamd21.go index 166df214fa..d30fc7f6f0 100644 --- a/src/runtime/runtime_atsamd21.go +++ b/src/runtime/runtime_atsamd21.go @@ -318,7 +318,7 @@ func readRTC() uint32 { // ticks are in microseconds // Returns true if the timer completed. -// Returns false if another interrupt occured which requires an early return to scheduler. +// Returns false if another interrupt occurred which requires an early return to scheduler. func timerSleep(ticks uint32) bool { timerWakeup.Set(0) if ticks < 7 { diff --git a/src/runtime/runtime_atsamd51.go b/src/runtime/runtime_atsamd51.go index 586ab00911..151f815813 100644 --- a/src/runtime/runtime_atsamd51.go +++ b/src/runtime/runtime_atsamd51.go @@ -307,7 +307,7 @@ func readRTC() uint32 { // ticks are in microseconds // Returns true if the timer completed. -// Returns false if another interrupt occured which requires an early return to scheduler. +// Returns false if another interrupt occurred which requires an early return to scheduler. func timerSleep(ticks uint32) bool { timerWakeup.Set(0) if ticks < 8 { diff --git a/src/runtime/runtime_avrtiny.go b/src/runtime/runtime_avrtiny.go index 63eb5943a2..8ce324938c 100644 --- a/src/runtime/runtime_avrtiny.go +++ b/src/runtime/runtime_avrtiny.go @@ -115,7 +115,7 @@ func sleepTicks(d timeUnit) { // Sleep until the next interrupt happens. avr.Asm("sei\nsleep\ncli") if cmpMatch.Get() != 0 { - // The CMP interrupt occured, so we have slept long enough. + // The CMP interrupt occurred, so we have slept long enough. cmpMatch.Set(0) break } diff --git a/src/runtime/runtime_cortexm_hardfault.go b/src/runtime/runtime_cortexm_hardfault.go index 1e264c286a..b2449ed910 100644 --- a/src/runtime/runtime_cortexm_hardfault.go +++ b/src/runtime/runtime_cortexm_hardfault.go @@ -8,7 +8,7 @@ import ( // This function is called at HardFault. // Before this function is called, the stack pointer is reset to the initial -// stack pointer (loaded from addres 0x0) and the previous stack pointer is +// stack pointer (loaded from address 0x0) and the previous stack pointer is // passed as an argument to this function. This allows for easy inspection of // the stack the moment a HardFault occurs, but it means that the stack will be // corrupted by this function and thus this handler must not attempt to recover. diff --git a/src/runtime/runtime_fe310.go b/src/runtime/runtime_fe310.go index 01cc3ba119..f65c39a4df 100644 --- a/src/runtime/runtime_fe310.go +++ b/src/runtime/runtime_fe310.go @@ -85,7 +85,7 @@ func handleInterrupt() { riscv.MCAUSE.Set(0) } -// initPeripherals configures periperhals the way the runtime expects them. +// initPeripherals configures peripherals the way the runtime expects them. func initPeripherals() { // Configure PLL to output 320MHz. // R=2: divide 16MHz to 8MHz diff --git a/src/runtime/runtime_k210.go b/src/runtime/runtime_k210.go index 5998de69db..96cdd63408 100644 --- a/src/runtime/runtime_k210.go +++ b/src/runtime/runtime_k210.go @@ -105,7 +105,7 @@ func handleInterrupt() { riscv.MCAUSE.Set(0) } -// initPeripherals configures periperhals the way the runtime expects them. +// initPeripherals configures peripherals the way the runtime expects them. func initPeripherals() { // Enable APB0 clock. kendryte.SYSCTL.CLK_EN_CENT.SetBits(kendryte.SYSCTL_CLK_EN_CENT_APB0_CLK_EN) diff --git a/src/syscall/syscall_libc_wasip1.go b/src/syscall/syscall_libc_wasip1.go index 5242690cc4..42a5b096d9 100644 --- a/src/syscall/syscall_libc_wasip1.go +++ b/src/syscall/syscall_libc_wasip1.go @@ -344,7 +344,7 @@ func Fdclosedir(dir uintptr) (err error) { func Readdir(dir uintptr) (dirent *Dirent, err error) { // There might be a leftover errno value in the global variable, so we have // to clear it before calling readdir because we cannot know whether a nil - // return means that we reached EOF or that an error occured. + // return means that we reached EOF or that an error occurred. libcErrno = 0 dirent = libc_readdir(unsafe.Pointer(dir)) diff --git a/stacksize/stacksize.go b/stacksize/stacksize.go index 8cccbaec61..2cc099f2ac 100644 --- a/stacksize/stacksize.go +++ b/stacksize/stacksize.go @@ -224,7 +224,7 @@ func CallGraph(f *elf.File, callsIndirectFunction []string) (map[string][]*CallN for name, size := range knownFrameSizes { if sym, ok := symbolNames[name]; ok { if len(sym) > 1 { - return nil, fmt.Errorf("expected zero or one occurence of the symbol %s, found %d", name, len(sym)) + return nil, fmt.Errorf("expected zero or one occurrence of the symbol %s, found %d", name, len(sym)) } sym[0].FrameSize = size sym[0].FrameSizeType = Bounded diff --git a/transform/optimizer.go b/transform/optimizer.go index cd4d1ee883..4c0ccfc2ea 100644 --- a/transform/optimizer.go +++ b/transform/optimizer.go @@ -27,7 +27,7 @@ func OptimizePackage(mod llvm.Module, config *compileopts.Config) { // passes. // // Please note that some optimizations are not optional, thus Optimize must -// alwasy be run before emitting machine code. +// always be run before emitting machine code. func Optimize(mod llvm.Module, config *compileopts.Config) []error { optLevel, speedLevel, _ := config.OptLevel()