From 9955b0bd6fba9fc82ce10bf0ab46d0cc17e4121c Mon Sep 17 00:00:00 2001 From: Pisit Sawangvonganan Date: Wed, 18 Sep 2024 15:07:04 +0700 Subject: [PATCH] style: arch: remove unnecessary `return` statements For code clarity, remove unnecessary `return` statements in functions with a void return type they don't affect control flow. Signed-off-by: Pisit Sawangvonganan --- arch/xtensa/include/kernel_arch_func.h | 2 +- include/zephyr/arch/riscv/sys_io.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/xtensa/include/kernel_arch_func.h b/arch/xtensa/include/kernel_arch_func.h index 4b5bac74ead..c422494ee2b 100644 --- a/arch/xtensa/include/kernel_arch_func.h +++ b/arch/xtensa/include/kernel_arch_func.h @@ -32,7 +32,7 @@ void xtensa_switch(void *switch_to, void **switched_from); static ALWAYS_INLINE void arch_switch(void *switch_to, void **switched_from) { - return xtensa_switch(switch_to, switched_from); + xtensa_switch(switch_to, switched_from); } #ifdef CONFIG_KERNEL_COHERENCE diff --git a/include/zephyr/arch/riscv/sys_io.h b/include/zephyr/arch/riscv/sys_io.h index 0437053d2a0..2bda1f7b2dd 100644 --- a/include/zephyr/arch/riscv/sys_io.h +++ b/include/zephyr/arch/riscv/sys_io.h @@ -41,7 +41,7 @@ static ALWAYS_INLINE uint8_t sys_read8(mem_addr_t addr) static ALWAYS_INLINE void sys_write8(uint8_t data, mem_addr_t addr) { - return z_soc_sys_write8(data, addr); + z_soc_sys_write8(data, addr); } static ALWAYS_INLINE uint16_t sys_read16(mem_addr_t addr) @@ -51,7 +51,7 @@ static ALWAYS_INLINE uint16_t sys_read16(mem_addr_t addr) static ALWAYS_INLINE void sys_write16(uint16_t data, mem_addr_t addr) { - return z_soc_sys_write16(data, addr); + z_soc_sys_write16(data, addr); } static ALWAYS_INLINE uint32_t sys_read32(mem_addr_t addr) @@ -61,7 +61,7 @@ static ALWAYS_INLINE uint32_t sys_read32(mem_addr_t addr) static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr) { - return z_soc_sys_write32(data, addr); + z_soc_sys_write32(data, addr); } static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr) @@ -71,7 +71,7 @@ static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr) static ALWAYS_INLINE void sys_write64(uint64_t data, mem_addr_t addr) { - return z_soc_sys_write64(data, addr); + z_soc_sys_write64(data, addr); } #endif /* CONFIG_RISCV_SOC_HAS_CUSTOM_SYS_IO */