From patchwork Fri Aug 16 21:05:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19255 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F070725A1B for ; Fri, 16 Aug 2013 21:06:18 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id a11sf2828964qcx.5 for ; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; 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=bJjlDZQIXSMAplSjcILZvbMSPLwPN45pxJCQCeucrS0=; b=Jovt1CaDDLkXtwtsFEeBfOlUThXaNpG4PvSvXa8BQESHhTPJO6xg8Qvv2N4K8Ol0pc h0GIV5a1WpXDyy6k0dJvNeNbMcMIlhtDaAlDwgxz+IC6ucn3nAG2JvlVECfRUOaKqAE3 IY+hFi/iOhWToe1J3x1iKqkJBKyuuboiWkZKXFNgCEGvP3Z1M2dYAD2QbmDJ1SejGyl5 KkwpekTDvE/tYOVPI8LCyhc+LvC51rGpMZNw51Hn7M60fbc3D59QcqKJZohDFTJpXAoC m/6peyjPCSQo3A/NfEnyOLPMw2TNO7F+l+Sqh+Yw/cOCwXYTLUOa6o7Ok5EGEAHkbQrH 9PDg== X-Received: by 10.236.31.228 with SMTP id m64mr1351251yha.5.1376687178729; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls957570qej.19.gmail; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) X-Received: by 10.221.47.193 with SMTP id ut1mr2905218vcb.8.1376687178587; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ui8si787065vcb.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.175; Received: by mail-vc0-f175.google.com with SMTP id ia10so1760238vcb.20 for ; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) X-Gm-Message-State: ALoCoQnqLCV8mVPrDWIMOvCDREM9cPcJzt5av301Aw9l/BqENlYhn4bXBbtGiFSc0bSkNhiB7eiK X-Received: by 10.52.117.79 with SMTP id kc15mr13414vdb.45.1376687178514; Fri, 16 Aug 2013 14:06:18 -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 u4csp89444vcz; Fri, 16 Aug 2013 14:06:18 -0700 (PDT) X-Received: by 10.194.93.105 with SMTP id ct9mr2574197wjb.6.1376687177599; Fri, 16 Aug 2013 14:06:17 -0700 (PDT) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx.google.com with ESMTPS id i10si1287492wjz.102.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:17 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.177 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.177; Received: by mail-we0-f177.google.com with SMTP id m46so2063905wev.22 for ; Fri, 16 Aug 2013 14:06:17 -0700 (PDT) X-Received: by 10.180.185.49 with SMTP id ez17mr639947wic.12.1376687176965; Fri, 16 Aug 2013 14:06:16 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id b13sm797327wic.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:16 -0700 (PDT) From: Julien Grall To: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com Cc: patches@linaro.org, andre.przywara@linaro.org, xen-devel@lists.xen.org, Julien Grall Subject: [RFC 07/24] xen: Use the right string comparison function in device tree Date: Fri, 16 Aug 2013 22:05:39 +0100 Message-Id: <1376687156-6737-8-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> References: <1376687156-6737-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.220.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 --- 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 b96ae33..362dd66 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; @@ -549,7 +549,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; @@ -579,7 +579,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 7cd9e19..e6a82cb 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -223,8 +223,8 @@ extern const struct dt_device_node *dt_interrupt_controller; */ struct dt_device_node * __init dt_find_interrupt_controller(const char *compat); -#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 1