From patchwork Thu Jan 22 16:56:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 43540 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C82E240DB for ; Thu, 22 Jan 2015 16:56:12 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf1697824wgg.0 for ; Thu, 22 Jan 2015 08:56:11 -0800 (PST) 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:subject:to:cc :in-reply-to:references:date:message-id:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=LkvHVUiyliqCbvrHnwvRYV3zVe9iFvK6Njkxi2q98xM=; b=XM8KJML2fs7wO1ujljV4CTwROUjdAHnAW8CEdLs6GFxfF7r3R/1qgFrjAAm85xUhJJ ZfBC2+YFC7Vhpbrx3664uuzk6TKD3HN5kkkDjwAvsyZ/BXChb29QF2l24ZNXIQESK+OJ tO1PKmuZB8jPDRhs2bfozRj2e4D0/HoVdiIuA964HRWvhMl3mW1oS+1kIoc1QcHi1hVF 0FSyyC9t83/+ZelH2qvrO/gYLfMpopL4h6EKZo6ZP6Z3iaPuTXiXioFflxTZ7CrHd+xj v/gPJ/bT1FPO3392I8bCOErRO1UJsh4S7aKLgUOKbIdeDg/SyWaDHe0bRFS48h+LHc7P I4WQ== X-Gm-Message-State: ALoCoQmvH9+xz3S7AA4pnit8DtNiXiipEk7x0anndu1woy8P51Vp/ryHA413TgYDBKhAYcoUs49/ X-Received: by 10.152.3.234 with SMTP id f10mr387901laf.1.1421945771825; Thu, 22 Jan 2015 08:56:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.34 with SMTP id cr2ls193673lad.30.gmail; Thu, 22 Jan 2015 08:56:11 -0800 (PST) X-Received: by 10.112.27.133 with SMTP id t5mr2802771lbg.45.1421945771630; Thu, 22 Jan 2015 08:56:11 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id dd11si22538985lac.130.2015.01.22.08.56.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 08:56:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id f15so2654987lbj.0 for ; Thu, 22 Jan 2015 08:56:11 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr2885609lac.70.1421945771511; Thu, 22 Jan 2015 08:56:11 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp326463lbb; Thu, 22 Jan 2015 08:56:10 -0800 (PST) X-Received: by 10.70.95.35 with SMTP id dh3mr3524713pdb.91.1421945769365; Thu, 22 Jan 2015 08:56:09 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pk2si12971975pbb.24.2015.01.22.08.56.08; Thu, 22 Jan 2015 08:56:09 -0800 (PST) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717AbbAVQ4H (ORCPT + 5 others); Thu, 22 Jan 2015 11:56:07 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38345 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752691AbbAVQ4G (ORCPT ); Thu, 22 Jan 2015 11:56:06 -0500 Received: by mail-wi0-f180.google.com with SMTP id bs8so4790350wib.1 for ; Thu, 22 Jan 2015 08:56:04 -0800 (PST) X-Received: by 10.180.211.169 with SMTP id nd9mr68028619wic.4.1421945764757; Thu, 22 Jan 2015 08:56:04 -0800 (PST) Received: from trevor.secretlab.ca (host81-159-185-229.range81-159.btcentralplus.com. [81.159.185.229]) by mx.google.com with ESMTPSA id kn7sm4654752wjc.45.2015.01.22.08.56.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 08:56:03 -0800 (PST) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id E4BA6C40A80; Thu, 22 Jan 2015 16:56:01 +0000 (GMT) From: Grant Likely Subject: Re: [PATCH v2] Removes OF_UNITTEST dependency on OF_DYNAMIC config symbol To: Gaurav Minocha , devicetree@vger.kernel.org Cc: rob.herring@linaro.org, Gaurav Minocha In-Reply-To: <1420960791-26761-1-git-send-email-gaurav.minocha.os@gmail.com> References: <1420960791-26761-1-git-send-email-gaurav.minocha.os@gmail.com> Date: Thu, 22 Jan 2015 16:56:01 +0000 Message-Id: <20150122165601.E4BA6C40A80@trevor.secretlab.ca> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Sat, 10 Jan 2015 23:19:51 -0800 , Gaurav Minocha wrote: > This patch intends to remove the unittests dependency on > the functions defined in dynamic.c. So, rather than calling > of_attach_node defined in dynamic.c, minimal functionality > required to attach a new node is re-defined in unittest.c. > Also, now after executing the tests the test data is not > removed from the device tree so there is no need to call > of_detach_node. > > Tested with and without OF_DYNAMIC enabled on ppc, arm and > x86 > > Signed-off-by: Gaurav Minocha Looks good, but it leaves in some stale node removal code. I've fixed it up and applied for v3.19. Here is my fixup: --- -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 139363af5c88..28beed1b3c2c 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -27,11 +27,6 @@ static struct selftest_results { int failed; } selftest_results; -#define NO_OF_NODES 3 -static struct device_node *nodes[NO_OF_NODES]; -static int last_node_index; -static bool selftest_live_tree; - #define selftest(result, fmt, ...) ({ \ bool failed = !(result); \ if (failed) { \ @@ -830,13 +825,6 @@ static int attach_node_and_children(struct device_node *np) return 0; } - /* Children of the root need to be remembered for removal */ - if (np->parent == of_root) { - if (WARN_ON(last_node_index >= NO_OF_NODES)) - return -EINVAL; - nodes[last_node_index++] = np; - } - child = np->child; np->child = NULL; @@ -899,8 +887,6 @@ static int __init selftest_data_add(void) } if (!of_root) { - /* enabling flag for removing nodes */ - selftest_live_tree = true; of_root = selftest_data_node; for_each_of_allnodes(np)