Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753880AbaDCWVh (ORCPT ); Thu, 3 Apr 2014 18:21:37 -0400 Received: from mail-oa0-f50.google.com ([209.85.219.50]:52342 "EHLO mail-oa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753936AbaDCWRu (ORCPT ); Thu, 3 Apr 2014 18:17:50 -0400 From: Rob Herring To: linux-kernel@vger.kernel.org Cc: Grant Likely , Rob Herring , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Subject: [PATCH 18/20] x86: use libfdt accessors for header data Date: Thu, 3 Apr 2014 17:17:01 -0500 Message-Id: <1396563423-30893-19-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1396563423-30893-1-git-send-email-robherring2@gmail.com> References: <1396563423-30893-1-git-send-email-robherring2@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring With libfdt support, we can take advantage of helper accessors in libfdt for accessing the FDT header data. This makes the code more readable and makes the FDT blob structure more opaque to the kernel. This also prepares for removing struct boot_param_header completely. Signed-off-by: Rob Herring Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org --- arch/x86/kernel/devicetree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index d35078e..f49f57f 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -206,16 +206,15 @@ static void __init dtb_apic_setup(void) static void __init x86_flattree_get_config(void) { u32 size, map_len; - struct boot_param_header *dt; + const void *dt; if (!initial_dtb) return; - map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), - (u64)sizeof(struct boot_param_header)); + map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), FDT_V17_SIZE); dt = early_memremap(initial_dtb, map_len); - size = be32_to_cpu(dt->totalsize); + size = fdt_totalsize(dt); if (map_len < size) { early_iounmap(dt, map_len); dt = early_memremap(initial_dtb, size); -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/