From patchwork Mon Aug 20 15:19:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 1349701 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7D8B0DFF0F for ; Mon, 20 Aug 2012 15:20:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757031Ab2HTPUW (ORCPT ); Mon, 20 Aug 2012 11:20:22 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:63516 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757022Ab2HTPUU (ORCPT ); Mon, 20 Aug 2012 11:20:20 -0400 Received: by qcro28 with SMTP id o28so4426194qcr.19 for ; Mon, 20 Aug 2012 08:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=GFqYzApBIjjt+jmazwkQ9xBNQrlmQYYms9UOMr8AkSs=; b=J3IsT0NdNxzn5e4r20cYuMdtSq7E0iOhk4jFV/NphT0cfNeHs9GPL1MkcnGo/Run9G UOq95xhSpP/dV5s1B7Siq0yWmSacB1VFLF7W6VUJAyXMFc9F2u0m8ufkRVWgcbVS0Rv5 CtKTVnEnCGqGvPQBJ9MN+G25B+SvPmYIUrfda1Qb8pS6gy3+x8SE6NqZ3ECojsQPhYOW o3Id5+0z3tu4ywhtYS0uT87KAcDMAKY0GOF4RkRIncLe+KUhSfeMefh7EhdGv5KVnXs8 QY28fN+DPD9n/CKjciUxF+RmuFP0I+CHkednFy0ZTt1A3e4gDlzfucNkFy2kkLaholRI K7rQ== Received: by 10.229.136.72 with SMTP id q8mr12756134qct.134.1345476019852; Mon, 20 Aug 2012 08:20:19 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPS id co12sm16290128qab.20.2012.08.20.08.20.18 (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 08:20:19 -0700 (PDT) From: alexdeucher@gmail.com To: airlied@gmail.com, dri-devel@lists.freedesktop.org, equinox@diac24.net Cc: linux-acpi@vger.kernel.org, Alex Deucher , stable@vger.kernel.org Subject: [PATCH 3/4] drm/radeon: convert radeon vfct code to use acpi_get_table_with_size Date: Mon, 20 Aug 2012 11:19:52 -0400 Message-Id: <1345475993-23853-3-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1345475993-23853-1-git-send-email-alexdeucher@gmail.com> References: <20120817170313.GA11909@srcf.ucam.org> <1345475993-23853-1-git-send-email-alexdeucher@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Alex Deucher Allows us to verify the table size. Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_bios.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index a32232f..ab0b2f7 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -482,13 +482,12 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) { bool ret = false; struct acpi_table_header *hdr; - /* acpi_get_table_with_size is not exported :( */ - acpi_size tbl_size = 0x7fffffff; + acpi_size tbl_size; UEFI_ACPI_VFCT *vfct; GOP_VBIOS_CONTENT *vbios; VFCT_IMAGE_HEADER *vhdr; - if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr))) + if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size))) return false; if (tbl_size < sizeof(UEFI_ACPI_VFCT)) { DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n"); @@ -525,7 +524,6 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) ret = !!rdev->bios; out_unmap: - /* uh, no idea what to do here... */ return ret; } #else