arch: x86: x86_mmu: Remove possible dead code

When __ASSERT is not enabled there is an attribution to the variable
total_partitions and it is never used.

MISRA-C rule 2.2

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-16 17:58:06 -08:00 committed by Anas Nashif
commit 34b12d8f16

View file

@ -284,15 +284,13 @@ void _arch_mem_domain_destroy(struct k_mem_domain *domain)
void _arch_mem_domain_partition_remove(struct k_mem_domain *domain,
u32_t partition_id)
{
u32_t total_partitions;
struct k_mem_partition partition;
if (domain == NULL) {
goto out;
}
total_partitions = domain->num_partitions;
__ASSERT(partition_id <= total_partitions,
__ASSERT(partition_id <= domain->num_partitions,
"invalid partitions");
partition = domain->partitions[partition_id];