From patchwork Mon Oct 14 05:17:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1175954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46s6KQ2136z9sPj for ; Mon, 14 Oct 2019 16:18:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="D9rzSBpv"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46s6KP6zZxzDqW9 for ; Mon, 14 Oct 2019 16:18:33 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46s6Jt0VRFzDqW9 for ; Mon, 14 Oct 2019 16:18:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="D9rzSBpv"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46s6Js4H7Vz9sPh; Mon, 14 Oct 2019 16:18:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571030285; bh=vpyVrmbz0vtmj9G3JU3n3ZWJDQyDeR+9boBTUhAVR7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9rzSBpvnl6Z/hCOEtZw7UL0Dsyx23SOt3uzz9iVfB3UBiqm307wRwCAHoDhn9DYo sRcTAmY0YMfhO+6ca4S+njKAZZNLtcXyPUd0nFK0UeDQTgC3fug+lGO5gPHV/6zYPM 14KUbTh8GoKQ/owm2SFMCVdUOvgAnM9IDc/77Xij4PzdfvwLs9pHGo3n4ViSRSbffL ePH8Fb3HU0y4E43jaKXMpCD16CohleboJM5IRX/J9Tf9vqOPdh8egR3T34wYxf50Lc OTGkdSh8AMHkRMMmw1vpJjM1/DzUbKVdrw4JqIc8KZyvunC2tJQWJVSxLc4IatWLck q9rdyjzuxtixQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 14 Oct 2019 16:17:23 +1100 Message-Id: <20191014051748.20190-6-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191014051748.20190-1-amitay@ozlabs.org> References: <20191014051748.20190-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v5 05/30] libpdbg: Rename function to reflect the functionality X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs Reviewed-by: Alistair Popple --- libpdbg/device.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libpdbg/device.c b/libpdbg/device.c index 6c3b769..6e2e7bb 100644 --- a/libpdbg/device.c +++ b/libpdbg/device.c @@ -173,26 +173,26 @@ static int dt_cmp_subnodes(const struct pdbg_target *a, const struct pdbg_target return strcmp(a->dn_name, b->dn_name); } -static bool dt_attach_root(struct pdbg_target *parent, struct pdbg_target *root) +static bool dt_attach_node(struct pdbg_target *parent, struct pdbg_target *child) { struct pdbg_target *node = NULL; - assert(!root->parent); + assert(!child->parent); if (list_empty(&parent->children)) { - list_add(&parent->children, &root->list); - root->parent = parent; + list_add(&parent->children, &child->list); + child->parent = parent; return true; } dt_for_each_child(parent, node) { - int cmp = dt_cmp_subnodes(node, root); + int cmp = dt_cmp_subnodes(node, child); /* Look for duplicates */ if (cmp == 0) { prerror("DT: %s failed, duplicate %s\n", - __func__, root->dn_name); + __func__, child->dn_name); return false; } @@ -202,8 +202,8 @@ static bool dt_attach_root(struct pdbg_target *parent, struct pdbg_target *root) break; } - list_add_before(&parent->children, &root->list, &node->list); - root->parent = parent; + list_add_before(&parent->children, &child->list, &node->list); + child->parent = parent; return true; } @@ -583,7 +583,7 @@ static int dt_expand_node(struct pdbg_target *node, const void *fdt, int fdt_nod * going for now, we may ultimately want to * assert */ - (void)dt_attach_root(node, child); + (void)dt_attach_node(node, child); break; case FDT_END: return -1;