From 790573d018c89352a0d41121b0befd2ee38f87b4 Mon Sep 17 00:00:00 2001 From: wenfei6316 Date: Fri, 7 Jan 2022 16:18:14 +0800 Subject: [PATCH] fix LOS_PaddrToKVaddr function logical redundancy Signed-off-by: wenfei6316 --- kernel/base/vm/los_vm_phys.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/kernel/base/vm/los_vm_phys.c b/kernel/base/vm/los_vm_phys.c index d1e006d3..852a6ccd 100644 --- a/kernel/base/vm/los_vm_phys.c +++ b/kernel/base/vm/los_vm_phys.c @@ -479,16 +479,6 @@ VOID LOS_PhysPagesFreeContiguous(VOID *ptr, size_t nPages) VADDR_T *LOS_PaddrToKVaddr(PADDR_T paddr) { - struct VmPhysSeg *seg = NULL; - UINT32 segID; - - for (segID = 0; segID < g_vmPhysSegNum; segID++) { - seg = &g_vmPhysSeg[segID]; - if ((paddr >= seg->start) && (paddr < (seg->start + seg->size))) { - return (VADDR_T *)(UINTPTR)(paddr - SYS_MEM_BASE + KERNEL_ASPACE_BASE); - } - } - return (VADDR_T *)(UINTPTR)(paddr - SYS_MEM_BASE + KERNEL_ASPACE_BASE); } -- GitLab