Commit 5b627ad8 authored by Abramo Bagnara's avatar Abramo Bagnara Committed by Anas Nashif
Browse files

coding guidelines: comply with MISRA C:2012 Rule 2.7



In particular:

- added missing ARG_UNUSED

- added void to cast where ARG_UNUSED macro is not available

Signed-off-by: default avatarAbramo Bagnara <abramo.bagnara@bugseng.com>
parent 839fa857
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
 */
__weak bool z_x86_do_kernel_nmi(const z_arch_esf_t *esf)
{
	ARG_UNUSED(esf);

	return false;
}

+7 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,

#if CONFIG_X86_STACK_PROTECTION
	z_x86_set_stack_guard(stack);
#else
	ARG_UNUSED(stack);
#endif
#ifdef CONFIG_USERSPACE
	switch_entry = z_x86_userspace_prepare_thread(thread);
@@ -65,11 +67,16 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
int arch_float_disable(struct k_thread *thread)
{
	/* x86-64 always has FP/SSE enabled so cannot be disabled */
	ARG_UNUSED(thread);

	return -ENOTSUP;
}

int arch_float_enable(struct k_thread *thread, unsigned int options)
{
	/* x86-64 always has FP/SSE enabled so nothing to do here */
	ARG_UNUSED(thread);
	ARG_UNUSED(options);

	return 0;
}
+4 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@ uint32_t pcie_msi_map(unsigned int irq,
	ARG_UNUSED(irq);
#if defined(CONFIG_INTEL_VTD_ICTL)
#if !defined(CONFIG_PCIE_MSI_X)
	ARG_UNUSED(vector);

	if (vector != NULL) {
		map = vtd_remap_msi(vtd, vector);
	} else
@@ -197,6 +199,8 @@ uint32_t pcie_msi_map(unsigned int irq,
		map = vtd_remap_msi(vtd, vector);
	} else
#endif
#else
	ARG_UNUSED(vector);
#endif
	{
		map = 0xFEE00000U; /* standard delivery to BSP local APIC */
+7 −0
Original line number Diff line number Diff line
@@ -449,6 +449,8 @@ static inline void assert_addr_aligned(uintptr_t addr)
#if __ASSERT_ON
	__ASSERT((addr & (CONFIG_MMU_PAGE_SIZE - 1)) == 0U,
		 "unaligned address 0x%" PRIxPTR, addr);
#else
	ARG_UNUSED(addr);
#endif
}

@@ -465,6 +467,8 @@ static inline void assert_region_page_aligned(void *addr, size_t size)
#if __ASSERT_ON
	__ASSERT((size & (CONFIG_MMU_PAGE_SIZE - 1)) == 0U,
		 "unaligned size %zu", size);
#else
	ARG_UNUSED(size);
#endif
}

@@ -788,6 +792,9 @@ static inline pentry_t pte_finalize_value(pentry_t val, bool user_table,
	    get_entry_phys(val, level) != shared_phys_addr) {
		val = ~val;
	}
#else
	ARG_UNUSED(user_table);
	ARG_UNUSED(level);
#endif
	return val;
}
+2 −0
Original line number Diff line number Diff line
@@ -217,6 +217,8 @@ static inline pentry_t *z_x86_thread_page_tables_get(struct k_thread *thread)
		 */
		return z_mem_virt_addr(thread->arch.ptables);
	}
#else
	ARG_UNUSED(thread);
#endif
	return z_x86_kernel_ptables;
}
Loading