Skip to content

Commit 4b7e092

Browse files
tychofrei02fabiobaltieri
authored andcommitted
arch: x86: coding guidelines: cast unused arguments to void
- added missing ARG_UNUSED - added void to cast where ARG_UNUSED macro is not available Signed-off-by: frei tycho <tfrei@baumer.com>
1 parent e726dc6 commit 4b7e092

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

arch/x86/core/intel64/fatal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
1515
*/
1616
__weak bool z_x86_do_kernel_nmi(const z_arch_esf_t *esf)
1717
{
18+
ARG_UNUSED(esf);
19+
1820
return false;
1921
}
2022

arch/x86/core/intel64/thread.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
3737
* which is only needed if the stack is not memory mapped.
3838
*/
3939
z_x86_set_stack_guard(stack);
40+
#else
41+
ARG_UNUSED(stack);
4042
#endif
4143
#ifdef CONFIG_USERSPACE
4244
switch_entry = z_x86_userspace_prepare_thread(thread);
@@ -68,11 +70,16 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
6870
int arch_float_disable(struct k_thread *thread)
6971
{
7072
/* x86-64 always has FP/SSE enabled so cannot be disabled */
73+
ARG_UNUSED(thread);
74+
7175
return -ENOTSUP;
7276
}
7377

7478
int arch_float_enable(struct k_thread *thread, unsigned int options)
7579
{
7680
/* x86-64 always has FP/SSE enabled so nothing to do here */
81+
ARG_UNUSED(thread);
82+
ARG_UNUSED(options);
83+
7784
return 0;
7885
}

arch/x86/core/x86_mmu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ static inline void assert_addr_aligned(uintptr_t addr)
450450
#if __ASSERT_ON
451451
__ASSERT((addr & (CONFIG_MMU_PAGE_SIZE - 1)) == 0U,
452452
"unaligned address 0x%" PRIxPTR, addr);
453+
#else
454+
ARG_UNUSED(addr);
453455
#endif
454456
}
455457

@@ -481,6 +483,8 @@ static inline void assert_size_aligned(size_t size)
481483
#if __ASSERT_ON
482484
__ASSERT((size & (CONFIG_MMU_PAGE_SIZE - 1)) == 0U,
483485
"unaligned size %zu", size);
486+
#else
487+
ARG_UNUSED(size);
484488
#endif
485489
}
486490

@@ -828,6 +832,9 @@ static inline pentry_t pte_finalize_value(pentry_t val, bool user_table,
828832
get_entry_phys(val, level) != shared_phys_addr) {
829833
val = ~val;
830834
}
835+
#else
836+
ARG_UNUSED(user_table);
837+
ARG_UNUSED(level);
831838
#endif
832839
return val;
833840
}

arch/x86/include/x86_mmu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ static inline pentry_t *z_x86_thread_page_tables_get(struct k_thread *thread)
217217
*/
218218
return z_mem_virt_addr(thread->arch.ptables);
219219
}
220+
#else
221+
ARG_UNUSED(thread);
220222
#endif
221223
return z_x86_kernel_ptables;
222224
}

arch/x86/zefi/zefi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ static void disable_hpet(void)
134134
*/
135135
uintptr_t __abi efi_entry(void *img_handle, struct efi_system_table *sys_tab)
136136
{
137+
(void)img_handle;
138+
137139
efi = sys_tab;
138140
z_putchar = efi_putchar;
139141
printf("*** Zephyr EFI Loader ***\n");

0 commit comments

Comments
 (0)