From patchwork Fri Sep 13 12:49:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20030 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 60BC328E98 for ; Fri, 13 Sep 2013 12:49:46 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id c41sf1212144yho.4 for ; Fri, 13 Sep 2013 05:49:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=Rd1EsGLJukpm+57+vSyLB3k7t8F5RH34pzAPseSdUcolLx2D2DTPTgI5/nZ3DbBqtl fvBhKAkSzYTU9dV2f+GszyDYynrkA81SYjp/Ch1/Fi00wSN2YTllIANoMG0xzDqO2Q2A O/GnRLZ4tB2wZTsYOTQ32JR/YABg+wl0pxPjXfAjrK0eTLHE6cjLz1XRZqAoD972JgY0 7t8hLUda/+eDmX2DtSj17SQBAAjz+Aq/O8oatHeA+KBHhvTZRbRPqisBwHWW0A97v/UH 0SbFqYZSRB4jm2lJCXiZcnTvXZuJp6ZhnXsRvryv9zkDxMEjk5yLcJ/2Ylny5RSD0QUv zEwA== X-Gm-Message-State: ALoCoQlCalQi0STw+nO5Pk0Vt8PO1ZAnc09bQu6iIpa5I4tnxlsflI5WGZgDHvZ4fwHr6apK3C07 X-Received: by 10.236.75.201 with SMTP id z49mr5108513yhd.0.1379076586044; Fri, 13 Sep 2013 05:49:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.65 with SMTP id 1ls1050029qek.72.gmail; Fri, 13 Sep 2013 05:49:45 -0700 (PDT) X-Received: by 10.220.249.67 with SMTP id mj3mr6820932vcb.23.1379076585807; Fri, 13 Sep 2013 05:49:45 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id tt2si3094713vcb.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x14so858210vbb.23 for ; Fri, 13 Sep 2013 05:49:45 -0700 (PDT) X-Received: by 10.58.233.173 with SMTP id tx13mr176785vec.31.1379076585685; Fri, 13 Sep 2013 05:49:45 -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 u4csp78765vcz; Fri, 13 Sep 2013 05:49:44 -0700 (PDT) X-Received: by 10.14.241.74 with SMTP id f50mr18252435eer.29.1379076584239; Fri, 13 Sep 2013 05:49:44 -0700 (PDT) Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175]) by mx.google.com with ESMTPS id o7si3773332eep.198.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.175 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.175; Received: by mail-ea0-f175.google.com with SMTP id m14so548590eaj.20 for ; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) X-Received: by 10.14.224.198 with SMTP id x46mr3112688eep.53.1379076583659; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm14678420eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:43 -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 v4 05/27] xen: Use the right string comparison function in device tree Date: Fri, 13 Sep 2013 13:49:12 +0100 Message-Id: <1379076574-28316-6-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> References: <1379076574-28316-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.212.50 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