]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioGpuDxe/Gop.c
UefiCpuPkg/PiSmmCpuDxeSmm: Skip if AllocatedSize is 0
[mirror_edk2.git] / OvmfPkg / VirtioGpuDxe / Gop.c
index c6ff9ed57461a0567f1a750e100dafef38bb1a95..3438bd03224e97dd8c8c0dad838c0b4500efe023 100644 (file)
@@ -204,7 +204,7 @@ GopQueryMode (
 {\r
   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GopModeInfo;\r
 \r
-  if (ModeNumber >= sizeof mGopResolutions / sizeof mGopResolutions[0]) {\r
+  if (ModeNumber >= ARRAY_SIZE (mGopResolutions)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -239,7 +239,7 @@ GopSetMode (
   EFI_STATUS Status;\r
   EFI_STATUS Status2;\r
 \r
-  if (ModeNumber >= sizeof mGopResolutions / sizeof mGopResolutions[0]) {\r
+  if (ModeNumber >= ARRAY_SIZE (mGopResolutions)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -258,8 +258,7 @@ GopSetMode (
     //\r
     VgpuGop->Gop.Mode = &VgpuGop->GopMode;\r
 \r
-    VgpuGop->GopMode.MaxMode         = (UINT32)(sizeof mGopResolutions /\r
-                                                sizeof mGopResolutions[0]);\r
+    VgpuGop->GopMode.MaxMode         = (UINT32)(ARRAY_SIZE (mGopResolutions));\r
     VgpuGop->GopMode.Info            = &VgpuGop->GopModeInfo;\r
     VgpuGop->GopMode.SizeOfInfo      = sizeof VgpuGop->GopModeInfo;\r
 \r