From patchwork Mon Jun 16 11:45:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 31956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9F70206A0 for ; Mon, 16 Jun 2014 11:47:16 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id eu11sf16577286pac.6 for ; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=rQiilYoidI4OeBuwL0IAbUTkcOQzw5d4aRjCAO979LY=; b=DY8DBC9sKkEIzvCV3f6h7MPrnIi4SC6Hp1l8JaHMg05R9Bm9ePpwDgcymC/ZOuwqCY HMqYcgLmKkPkikVa/8ZU3+tXpZ9mxxzP6Dya/MoMVGCYzn+ynQLO9E5TK76Wim/M824A tTQBxvzTE8F207m5bm1+fVm0XnNgoegC6e3FlV0cleNdg/QTb7VSleGbJk0cpwEWsgbw aEnU5YmDAj28qS0UE8uGh3hd4A0jcrbFbbI7heUeAIaSB+PrMdiUI8DmZneYCMoGlymq qUt7RYBAAveMxS4hMzWMraAiokUvFJCvB/op8mmf4A4jQepznrLLyIjI/BYTKV/KDELa mvfA== X-Gm-Message-State: ALoCoQlds8GT0ke9WodoxyZhaWJ7c8IAm6Ynz+cAlZ+1oxt9pwRBw2blXESgkW1cXSOyrf/QETyR X-Received: by 10.66.149.67 with SMTP id ty3mr2112423pab.27.1402919236199; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.179 with SMTP id i48ls1175806qge.82.gmail; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) X-Received: by 10.58.195.234 with SMTP id ih10mr497445vec.41.1402919236052; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id zm3si3995089vdc.71.2014.06.16.04.47.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:47:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so4693512vcb.5 for ; Mon, 16 Jun 2014 04:47:15 -0700 (PDT) X-Received: by 10.52.94.8 with SMTP id cy8mr855094vdb.39.1402919235929; Mon, 16 Jun 2014 04:47:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp128529vcb; Mon, 16 Jun 2014 04:47:15 -0700 (PDT) X-Received: by 10.140.24.98 with SMTP id 89mr23889082qgq.33.1402919235516; Mon, 16 Jun 2014 04:47:15 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l4si5127368qao.132.2014.06.16.04.47.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:47:15 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwVLf-0003Qq-21; Mon, 16 Jun 2014 11:45:15 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwVLZ-0003M2-1E for xen-devel@lists.xen.org; Mon, 16 Jun 2014 11:45:10 +0000 Received: from [85.158.139.211:16534] by server-12.bemta-5.messagelabs.com id 09/02-27841-4C8DE935; Mon, 16 Jun 2014 11:45:08 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1402919104!10179946!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4877 invoked from network); 16 Jun 2014 11:45:07 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jun 2014 11:45:07 -0000 X-IronPort-AV: E=Sophos;i="5.01,486,1400025600"; d="scan'208";a="143697244" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 16 Jun 2014 11:45:04 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Mon, 16 Jun 2014 07:45:04 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwVLU-000152-36; Mon, 16 Jun 2014 12:45:04 +0100 From: Ian Campbell To: Date: Mon, 16 Jun 2014 12:45:02 +0100 Message-ID: <1402919103-29642-9-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402919079.14907.22.camel@kazak.uk.xensource.com> References: <1402919079.14907.22.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, Naresh Bhat , julien.grall@linaro.org, tim@xen.org, Roy Franz , Fu Wei Subject: [Xen-devel] [PATCH 09/10] xen: arm: Drop device_tree_node_compatible X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Instead use fdt_node_check_compatible from libfdt. Signed-off-by: Ian Campbell --- xen/arch/arm/bootfdt.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index a80055c..8ab45c9 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -31,30 +31,6 @@ static bool_t __init device_tree_node_matches(const void *fdt, int node, && (name[match_len] == '@' || name[match_len] == '\0'); } -static bool_t __init device_tree_node_compatible(const void *fdt, int node, - const char *match) -{ - int len, l; - int mlen; - const void *prop; - - mlen = strlen(match); - - prop = fdt_getprop(fdt, node, "compatible", &len); - if ( prop == NULL ) - return 0; - - while ( len > 0 ) { - if ( !dt_compat_cmp(prop, match) ) - return 1; - l = strlen(prop) + 1; - prop += l; - len -= l; - } - - return 0; -} - static void __init device_tree_get_reg(const __be32 **cell, u32 address_cells, u32 size_cells, u64 *start, u64 *size) { @@ -261,8 +237,8 @@ static int __init early_scan_node(const void *fdt, { if ( device_tree_node_matches(fdt, node, "memory") ) process_memory_node(fdt, node, name, address_cells, size_cells); - else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) || - device_tree_node_compatible(fdt, node, "multiboot,module" )) + else if ( fdt_node_check_compatible(fdt, node, "xen,multiboot-module" ) || + fdt_node_check_compatible(fdt, node, "multiboot,module" )) process_multiboot_node(fdt, node, name, address_cells, size_cells); else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") ) process_chosen_node(fdt, node, name, address_cells, size_cells);