From patchwork Fri Feb 27 05:06:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 444144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E02EF14012A for ; Fri, 27 Feb 2015 16:06:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=XRztdnMt; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id BC6A41A0061 for ; Fri, 27 Feb 2015 16:06:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=XRztdnMt; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id C0DEE1A0060 for ; Fri, 27 Feb 2015 16:06:41 +1100 (AEDT) Received: by pabrd3 with SMTP id rd3so19790100pab.4 for ; Thu, 26 Feb 2015 21:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HzhTPe5WUCD7ub26EjgcUNv5ghs3Yfd2N69D4XZLB9Q=; b=XRztdnMt/mIaGX84t7v9kfJsAZVkXEdwA1wa7692uQb1jacqxVJbCK6v0jPlDOncJH kkVuF8K8xxp8d1dubLiWiPzSuQl1WGXO7rsCLbFWFhJ2+G5bWZQ6PVyW37Gdehx5FE9f XU4H/vNpPe58+/TfcpajvAqxo0phE/tQNoxnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HzhTPe5WUCD7ub26EjgcUNv5ghs3Yfd2N69D4XZLB9Q=; b=bPoK9/hbp0Ks12U2xRomMlHUCXM9DbyNj+LujNSxW9fLPZs3RgmtW/2QNgso5ocdNh tNcB1vhjxOfPl6mnZMmjGs1EcNCpbqwNq9bLNxSm2m9VHQ3tI6PjzJ9Gl/NC9z4zIeXG /Vwo+0deCy34FGZ9/VCgoW+om9oQRA0bnAr+alQdCjPLEKm5rVc5uUQXcCABZ/rxs9z2 5F48qgzxDJSpInSRoHrOb52CLchuNr5QGBh+uWloAwdwCgZtTlGCDhDXfPd7beIcZn5g I95OVeFIjlxLinUryElLTCp3iB1M3ypIKZlAikwQui7SgWQgXwWI9ydCIO79uk16ET+x tzcQ== X-Gm-Message-State: ALoCoQmyOcQQz0MU/VhIdKq/8FicvW0HchggBaVVHDkmRCld/val3fktuC/6Dh7Yk9pAJbvnUgRf X-Received: by 10.70.41.161 with SMTP id g1mr20981094pdl.43.1425013600029; Thu, 26 Feb 2015 21:06:40 -0800 (PST) Received: from omicron.ozlabs.ibm.com (bh02i525f01.au.ibm.com. [202.81.18.30]) by mx.google.com with ESMTPSA id qj3sm2590607pac.31.2015.02.26.21.06.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 21:06:39 -0800 (PST) From: Daniel Axtens To: skiboot@lists.ozlabs.org Date: Fri, 27 Feb 2015 16:06:33 +1100 Message-Id: <1425013595-13600-3-git-send-email-dja@axtens.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425013595-13600-1-git-send-email-dja@axtens.net> References: <1425013595-13600-1-git-send-email-dja@axtens.net> Subject: [Skiboot] [PATCH 2/4] core/test: Use "" as the name of the device tree root node. X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The device tree tests use "root" as the name of the root node. That leads to weird discrepancies between the reported path and the dt_find_by_path path. The empty string is already used as the root name in dt_expand. Signed-off-by: Daniel Axtens --- core/test/run-device.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/test/run-device.c b/core/test/run-device.c index e2ce340..cf8e741 100644 --- a/core/test/run-device.c +++ b/core/test/run-device.c @@ -53,61 +53,61 @@ int main(void) struct dt_property *p2; unsigned int n; - root = dt_new_root("root"); + root = dt_new_root(""); assert(!list_top(&root->properties, struct dt_property, list)); - check_path(root, "/root"); + check_path(root, "/"); c1 = dt_new(root, "c1"); assert(!list_top(&c1->properties, struct dt_property, list)); - check_path(c1, "root/c1"); + check_path(c1, "/c1"); assert(dt_find_by_name(root, "c1") == c1); assert(dt_find_by_path(root, "/c1") == c1); c2 = dt_new(root, "c2"); assert(!list_top(&c2->properties, struct dt_property, list)); - check_path(c2, "root/c2"); + check_path(c2, "/c2"); assert(dt_find_by_name(root, "c2") == c2); assert(dt_find_by_path(root, "/c2") == c2); gc1 = dt_new(c1, "gc1"); assert(!list_top(&gc1->properties, struct dt_property, list)); - check_path(gc1, "root/c1/gc1"); + check_path(gc1, "/c1/gc1"); assert(dt_find_by_name(root, "gc1") == gc1); assert(dt_find_by_path(root, "/c1/gc1") == gc1); gc2 = dt_new(c1, "gc2"); assert(!list_top(&gc2->properties, struct dt_property, list)); - check_path(gc2, "root/c1/gc2"); + check_path(gc2, "/c1/gc2"); assert(dt_find_by_name(root, "gc2") == gc2); assert(dt_find_by_path(root, "/c1/gc2") == gc2); gc3 = dt_new(c1, "gc3"); assert(!list_top(&gc3->properties, struct dt_property, list)); - check_path(gc3, "root/c1/gc3"); + check_path(gc3, "/c1/gc3"); assert(dt_find_by_name(root, "gc3") == gc3); assert(dt_find_by_path(root, "/c1/gc3") == gc3); ggc1 = dt_new(gc1, "ggc1"); assert(!list_top(&ggc1->properties, struct dt_property, list)); - check_path(ggc1, "root/c1/gc1/ggc1"); + check_path(ggc1, "/c1/gc1/ggc1"); assert(dt_find_by_name(root, "ggc1") == ggc1); assert(dt_find_by_path(root, "/c1/gc1/ggc1") == ggc1); addrs = dt_new(root, "addrs"); assert(!list_top(&addrs->properties, struct dt_property, list)); - check_path(addrs, "root/addrs"); + check_path(addrs, "/addrs"); assert(dt_find_by_name(root, "addrs") == addrs); assert(dt_find_by_path(root, "/addrs") == addrs); addr1 = dt_new_addr(addrs, "addr", 0x1337); assert(!list_top(&addr1->properties, struct dt_property, list)); - check_path(addr1, "root/addrs/addr@1337"); + check_path(addr1, "/addrs/addr@1337"); assert(dt_find_by_name(root, "addr@1337") == addr1); assert(dt_find_by_path(root, "/addrs/addr@1337") == addr1); addr2 = dt_new_2addr(addrs, "2addr", 0xdead, 0xbeef); assert(!list_top(&addr2->properties, struct dt_property, list)); - check_path(addr2, "root/addrs/2addr@dead,beef"); + check_path(addr2, "/addrs/2addr@dead,beef"); assert(dt_find_by_name(root, "2addr@dead,beef") == addr2); assert(dt_find_by_path(root, "/addrs/2addr@dead,beef") == addr2);