From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C52DF1A1ECF for ; Wed, 12 Oct 2016 03:09:17 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 595C990E48; Wed, 12 Oct 2016 10:09:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-37.phx2.redhat.com [10.3.116.37]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9CA99vg006514; Wed, 12 Oct 2016 06:09:16 -0400 From: Laszlo Ersek To: edk2-devel-01 Cc: Jordan Justen Date: Wed, 12 Oct 2016 12:09:04 +0200 Message-Id: <20161012100905.6296-5-lersek@redhat.com> In-Reply-To: <20161012100905.6296-1-lersek@redhat.com> References: <20161012100905.6296-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 12 Oct 2016 10:09:17 +0000 (UTC) Subject: [PATCH 4/5] OvmfPkg/QemuVideoDxe: remove useless QEMU_VIDEO_PRIVATE_DATA.LineBuffer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 10:09:18 -0000 This field is (re)allocated in QemuVideoGraphicsOutputSetMode(), released in QemuVideoGraphicsOutputDestructor(), and used for nothing else. Remove it. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/QemuVideoDxe/Qemu.h | 1 - OvmfPkg/QemuVideoDxe/Gop.c | 16 ---------------- 2 files changed, 17 deletions(-) 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) { -- 2.9.2