From patchwork Wed Oct 12 10:09:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 77541 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp377500qge; Wed, 12 Oct 2016 03:09:21 -0700 (PDT) X-Received: by 10.66.101.35 with SMTP id fd3mr403884pab.170.1476266961392; Wed, 12 Oct 2016 03:09:21 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id 2si5118661pgc.316.2016.10.12.03.09.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Oct 2016 03:09:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 092B81A1ED2; Wed, 12 Oct 2016 03:09:19 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org 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 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: [edk2] [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: , Cc: Jordan Justen MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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) {