diff mbox

[edk2,4/5] OvmfPkg/QemuVideoDxe: remove useless QEMU_VIDEO_PRIVATE_DATA.LineBuffer

Message ID 20161012100905.6296-5-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek Oct. 12, 2016, 10:09 a.m. UTC
This field is (re)allocated in QemuVideoGraphicsOutputSetMode(), released
in QemuVideoGraphicsOutputDestructor(), and used for nothing else. Remove
it.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 OvmfPkg/QemuVideoDxe/Qemu.h |  1 -
 OvmfPkg/QemuVideoDxe/Gop.c  | 16 ----------------
 2 files changed, 17 deletions(-)

-- 
2.9.2


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h
index f3358d8a7ce0..2ce37defc5b8 100644
--- a/OvmfPkg/QemuVideoDxe/Qemu.h
+++ b/OvmfPkg/QemuVideoDxe/Qemu.h
@@ -114,11 +114,10 @@  typedef struct {
   // EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.MaxMode field.
   //
   UINTN                                 MaxMode;
   QEMU_VIDEO_MODE_DATA                  *ModeData;
 
-  UINT8                                 *LineBuffer;
   QEMU_VIDEO_VARIANT                    Variant;
   FRAME_BUFFER_CONFIGURE                *FrameBufferBltConfigure;
   UINTN                                 FrameBufferBltConfigureSize;
 } QEMU_VIDEO_PRIVATE_DATA;
 
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index 532f20e6446c..5485ba3c2871 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -165,19 +165,10 @@  Routine Description:
     return EFI_UNSUPPORTED;
   }
 
   ModeData = &Private->ModeData[ModeNumber];
 
-  if (Private->LineBuffer) {
-    gBS->FreePool (Private->LineBuffer);
-  }
-
-  Private->LineBuffer = AllocatePool (4 * ModeData->HorizontalResolution);
-  if (Private->LineBuffer == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
   switch (Private->Variant) {
   case QEMU_VIDEO_CIRRUS_5430:
   case QEMU_VIDEO_CIRRUS_5446:
     InitializeCirrusGraphicsMode (Private, &QemuVideoCirrusModes[ModeData->InternalModeIndex]);
     break;
@@ -185,12 +176,10 @@  Routine Description:
   case QEMU_VIDEO_BOCHS:
     InitializeBochsGraphicsMode (Private, &QemuVideoBochsModes[ModeData->InternalModeIndex]);
     break;
   default:
     ASSERT (FALSE);
-    gBS->FreePool (Private->LineBuffer);
-    Private->LineBuffer = NULL;
     return EFI_DEVICE_ERROR;
   }
 
   This->Mode->Mode = ModeNumber;
   This->Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;
@@ -347,11 +336,10 @@  QemuVideoGraphicsOutputConstructor (
   if (EFI_ERROR (Status)) {
     goto FreeMode;
   }
   Private->GraphicsOutput.Mode->MaxMode = (UINT32) Private->MaxMode;
   Private->GraphicsOutput.Mode->Mode    = GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER;
-  Private->LineBuffer                   = NULL;
   Private->FrameBufferBltConfigure      = NULL;
   Private->FrameBufferBltConfigureSize  = 0;
 
   //
   // Initialize the hardware
@@ -393,14 +381,10 @@  Returns:
 
   None
 
 --*/
 {
-  if (Private->LineBuffer != NULL) {
-    FreePool (Private->LineBuffer);
-  }
-
   if (Private->FrameBufferBltConfigure != NULL) {
     FreePool (Private->FrameBufferBltConfigure);
   }
 
   if (Private->GraphicsOutput.Mode != NULL) {