From 5a5025e485b299c76ebed79fa63ba88a5b219a12 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Thu, 27 Oct 2016 18:16:15 +0800 Subject: OvmfPkg: Make more use of ARRAY_SIZE() Convert the remaining pieces to make the code shorter and more readable. Cc: Justen Jordan Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin Reviewed-by: Laszlo Ersek [lersek@redhat.com: tweak subject line] Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/LoadLinuxLib/Linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OvmfPkg/Library/LoadLinuxLib') diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c b/OvmfPkg/Library/LoadLinuxLib/Linux.c index 9c996adfbb..68d15377bf 100644 --- a/OvmfPkg/Library/LoadLinuxLib/Linux.c +++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c @@ -357,7 +357,7 @@ SetupLinuxMemmap ( LastE820->size += EFI_PAGES_TO_SIZE ((UINTN) MemoryMap->NumberOfPages); LastEndAddr += EFI_PAGES_TO_SIZE ((UINTN) MemoryMap->NumberOfPages); } else { - if (E820EntryCount >= (sizeof (Bp->e820_map) / sizeof (Bp->e820_map[0]))) { + if (E820EntryCount >= ARRAY_SIZE (Bp->e820_map)) { break; } E820->type = (UINT32) E820Type; -- cgit v1.2.3