From patchwork Tue Mar 1 17:41:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 63323 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1963067lbc; Tue, 1 Mar 2016 09:47:21 -0800 (PST) X-Received: by 10.140.95.117 with SMTP id h108mr27843506qge.65.1456854440980; Tue, 01 Mar 2016 09:47:20 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u185si31718041qhu.83.2016.03.01.09.47.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 01 Mar 2016 09:47:20 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([::1]:51423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaoOG-0000mJ-Do for patch@linaro.org; Tue, 01 Mar 2016 12:47:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaoMp-0007VJ-12 for grub-devel@gnu.org; Tue, 01 Mar 2016 12:47:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaoIx-0007lu-23 for grub-devel@gnu.org; Tue, 01 Mar 2016 12:45:50 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:33986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaoIw-0007lp-Oz for grub-devel@gnu.org; Tue, 01 Mar 2016 12:41:50 -0500 Received: by mail-wm0-x22c.google.com with SMTP id p65so46106680wmp.1 for ; Tue, 01 Mar 2016 09:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kxS9JmI2ZvM3ekrDR8YJwNyokBWuZFqdiWXMUylAcjQ=; b=S10GIB/puiJEM+JApKUffm/4SxIvyxWrVt/bgQT6PPfBVyQH+hqat365Wpb5gkxWd/ mBDPDjVGgv5ht++tzyIdwvxuC1Kd4bIW+MGlM9gUnvVWbLHZ5BKTYD0jDd2wH1rG2Xkt Ft/+1GaJgpSoSQzs2pBK3kixL+c/0NSNBlT/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kxS9JmI2ZvM3ekrDR8YJwNyokBWuZFqdiWXMUylAcjQ=; b=HvBey92zsY1omxFUXxmwRigmV+lEGFmcv909OGkZ4tCT8Dp6vAwwX58WzzcfmNG/+F rDuingkxUd4mNAwLf1nyqXRCZ/8b9gxjyc6fjky4wKGlzuAlDujbNp52xzPg9tXn29qm dPfIXqBSolNH4+YpTC2ALIMMkOPdCIJppk9mN+++txfiNPQeep9UECaPR7kwPiiMpMPL UNvSk9fDVnXiWv7DeYlBT/MniQPz2HINkNVIAtIVjDNIW9LRTjIkch0BsyrqQ4vWE1ng C7dECFy4qWaOBU9S3e87VJVhcVqw2wVeq3rggNlZ1V+xmGDA9AxNptZ1uL2ic3JgtQKe L5uA== X-Gm-Message-State: AD7BkJKu0tyNmTn5WURmDzAu9tKubre9C0yxElqs26AVgPeRtFQHIgmkAPGw0Gae36gJOoFJ X-Received: by 10.28.45.150 with SMTP id t144mr275114wmt.84.1456854110086; Tue, 01 Mar 2016 09:41:50 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc92308-cmbg19-2-0-cust814.5-4.cable.virginm.net. [82.24.251.47]) by smtp.gmail.com with ESMTPSA id fv6sm31974541wjc.12.2016.03.01.09.41.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 09:41:49 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [RFC 2/3] arm64 linux loader: use grub_efi_find_config_table to find DT Date: Tue, 1 Mar 2016 17:41:42 +0000 Message-Id: <1456854103-12095-3-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456854103-12095-1-git-send-email-leif.lindholm@linaro.org> References: <1456854103-12095-1-git-send-email-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22c Cc: Alexander Graf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: grub-devel-bounces+patch=linaro.org@gnu.org Use new helper function rather than manually iterating through system table. --- grub-core/loader/arm64/fdt.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) -- 2.1.4 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/arm64/fdt.c index 5202c14..16222a4 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/arm64/fdt.c @@ -31,23 +31,9 @@ static void *fdt; static void * get_firmware_fdt (void) { - grub_efi_configuration_table_t *tables; grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; - void *firmware_fdt = NULL; - unsigned int i; - /* Look for FDT in UEFI config tables. */ - tables = grub_efi_system_table->configuration_table; - - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) - { - firmware_fdt = tables[i].vendor_table; - grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); - break; - } - - return firmware_fdt; + return grub_efi_find_config_table (&fdt_guid); } void *