From patchwork Tue Sep 10 14:48:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19907 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A788825E85 for ; Tue, 10 Sep 2013 14:49:30 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf9099296qcv.3 for ; Tue, 10 Sep 2013 07:49:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=InMD01exz7Ipi4CV8VPk4wOCpaZIUmaE9cb6L6Sqysw=; b=GVXmFp4NV4nl6eswWuP9CLW2zFaLL6/Aviqn/Isd2dWU9m8CGQSBiFSQnxlAY3kj2e z8Y+2dnP6FFRt4VQVkQQBjaW8lwEWNHky229jNVaKa7f+E7RHZIHxNQ9BT/G3CLpm5Zk O3Zg0NkFrwPQ+AG45DYxvKNV49M/ZuG71l44uth4BbFv9Mx+gOJv7GSCOOlsUL0rg2sF th0fqfyyI6FCcmuS6P1HE4hmIz4/yxRNJ9W8xwu6RTYFIwOJWIRt1hEdQwoSRzoNl+oN Zh+LR+xYVy3lVBjyOcc60wMae1TBzUkTmyD4p2nemfamvx8Kqe5hXDWzftitsCmgrvCC 4FKA== X-Received: by 10.236.115.198 with SMTP id e46mr9119665yhh.33.1378824570348; Tue, 10 Sep 2013 07:49:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.35 with SMTP id q3ls2215825qev.50.gmail; Tue, 10 Sep 2013 07:49:30 -0700 (PDT) X-Received: by 10.52.103.73 with SMTP id fu9mr1348659vdb.29.1378824570100; Tue, 10 Sep 2013 07:49:30 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id h2si4539416vcy.17.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jy13so4536793veb.20 for ; Tue, 10 Sep 2013 07:49:30 -0700 (PDT) X-Gm-Message-State: ALoCoQnkQk2R3bVd91+GjUEVT1FEspxS+IoKqLopQY8PaObKr1nHd8FBCK4H0TqBxGYtdjhpsUyh X-Received: by 10.220.174.200 with SMTP id u8mr23329477vcz.6.1378824569993; Tue, 10 Sep 2013 07:49:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp4650vcz; Tue, 10 Sep 2013 07:49:29 -0700 (PDT) X-Received: by 10.15.63.2 with SMTP id l2mr326319eex.93.1378824567921; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by mx.google.com with ESMTPS id e49si15274327eep.321.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:27 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.52 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.52; Received: by mail-ee0-f52.google.com with SMTP id c41so3892031eek.39 for ; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) X-Received: by 10.14.42.3 with SMTP id i3mr331638eeb.95.1378824567000; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:26 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH v3 05/27] xen: Use the right string comparison function in device tree Date: Tue, 10 Sep 2013 15:48:53 +0100 Message-Id: <1378824555-16564-6-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When of_node_cmp and of_compat_cmp was introduced in commit fb97eb6 "xen/arm: Create a hierarchical device tree", they were copied from the wrong Linux header. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v3: - This patch depends on "xen/dts: Add new helpers...". Move the patch later. --- xen/common/device_tree.c | 6 +++--- xen/include/xen/device_tree.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 7e451b1..a73eee8 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -144,7 +144,7 @@ bool_t __init device_tree_node_compatible(const void *fdt, int node, return 0; while ( len > 0 ) { - if ( !dt_compat_cmp(prop, match, mlen) ) + if ( !dt_compat_cmp(prop, match) ) return 1; l = strlen(prop) + 1; prop += l; @@ -564,7 +564,7 @@ dt_find_property(const struct dt_device_node *np, for ( pp = np->properties; pp; pp = pp->next ) { - if ( strcmp(pp->name, name) == 0 ) + if ( dt_prop_cmp(pp->name, name) == 0 ) { if ( lenp ) *lenp = pp->length; @@ -626,7 +626,7 @@ bool_t dt_device_is_compatible(const struct dt_device_node *device, return 0; while ( cplen > 0 ) { - if ( dt_compat_cmp(cp, compat, strlen(compat)) == 0 ) + if ( dt_compat_cmp(cp, compat) == 0 ) return 1; l = strlen(cp) + 1; cp += l; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 91caf1f..5a51ab6 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -243,8 +243,8 @@ extern const struct dt_device_node *dt_interrupt_controller; struct dt_device_node * __init dt_find_interrupt_controller(const char *compat); #define dt_prop_cmp(s1, s2) strcmp((s1), (s2)) -#define dt_node_cmp(s1, s2) strcmp((s1), (s2)) -#define dt_compat_cmp(s1, s2, l) strnicmp((s1), (s2), l) +#define dt_node_cmp(s1, s2) strcasecmp((s1), (s2)) +#define dt_compat_cmp(s1, s2) strcasecmp((s1), (s2)) /* Default #address and #size cells */ #define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 2