diff options
author | Gary Lin <glin@suse.com> | 2016-10-27 18:16:15 +0800 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2016-10-27 18:21:06 +0200 |
commit | 5a5025e485b299c76ebed79fa63ba88a5b219a12 (patch) | |
tree | 98b46b4a3bce19139e37f8d84a488b6968bb1db7 /OvmfPkg/VirtioGpuDxe | |
parent | 1399565a93a7457db262ae2cb81431062fcc30c4 (diff) | |
download | edk2-5a5025e485b299c76ebed79fa63ba88a5b219a12.zip edk2-5a5025e485b299c76ebed79fa63ba88a5b219a12.tar.gz edk2-5a5025e485b299c76ebed79fa63ba88a5b219a12.tar.bz2 |
OvmfPkg: Make more use of ARRAY_SIZE()
Convert the remaining pieces to make the code shorter and more readable.
Cc: Justen Jordan <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: tweak subject line]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/VirtioGpuDxe')
-rw-r--r-- | OvmfPkg/VirtioGpuDxe/Gop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/OvmfPkg/VirtioGpuDxe/Gop.c b/OvmfPkg/VirtioGpuDxe/Gop.c index c6ff9ed..3438bd0 100644 --- a/OvmfPkg/VirtioGpuDxe/Gop.c +++ b/OvmfPkg/VirtioGpuDxe/Gop.c @@ -204,7 +204,7 @@ GopQueryMode ( {
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GopModeInfo;
- if (ModeNumber >= sizeof mGopResolutions / sizeof mGopResolutions[0]) {
+ if (ModeNumber >= ARRAY_SIZE (mGopResolutions)) {
return EFI_INVALID_PARAMETER;
}
@@ -239,7 +239,7 @@ GopSetMode ( EFI_STATUS Status;
EFI_STATUS Status2;
- if (ModeNumber >= sizeof mGopResolutions / sizeof mGopResolutions[0]) {
+ if (ModeNumber >= ARRAY_SIZE (mGopResolutions)) {
return EFI_UNSUPPORTED;
}
@@ -258,8 +258,7 @@ GopSetMode ( //
VgpuGop->Gop.Mode = &VgpuGop->GopMode;
- VgpuGop->GopMode.MaxMode = (UINT32)(sizeof mGopResolutions /
- sizeof mGopResolutions[0]);
+ VgpuGop->GopMode.MaxMode = (UINT32)(ARRAY_SIZE (mGopResolutions));
VgpuGop->GopMode.Info = &VgpuGop->GopModeInfo;
VgpuGop->GopMode.SizeOfInfo = sizeof VgpuGop->GopModeInfo;
|