From patchwork Tue Oct 7 10:36:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 38393 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD12B2057C for ; Tue, 7 Oct 2014 10:36:39 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id m15sf3861238wgh.7 for ; Tue, 07 Oct 2014 03:36:38 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=I5msVvVxj6ue0q+m7Wu1pzClsT1VS8vSObYLy9TBZZo=; b=khxEkp7OjYST3hJSJVL7ykQsnvjBXnANx7YBJRpBBjUByBUwxsYsvd6Nwuv6wN/ilr F78FM2UZITQkDId7uD3cl7uNIBZjcF3SUEGzaSxo0H1rzFxLhbril4+aCjwWzt63kir4 BumvFmjXzcILKqLKI7G1d7c40cSMiUwkVYkF12QeTlXKK4TibYH5KSdatS0rEU4bkQY7 f7WdWJ3kdMu9YHNiFyIq5q37zSr6VBkS2kMH2no+XW22Cy9h/4ciz5QOrGEN3QtCa5kn bCiNywFWdVVahnFLByLBVgDU3ADckSH7Qc9CqYGU5I00AtR6+9X5mi2nyO9UtkJl1g3c +6YQ== X-Gm-Message-State: ALoCoQny8GuL/ZMlAN0cg4Hu+AMh6UHF+RycJntjQhPl/LM/wqwRqycdO/6e4mHQAX1eSK374CLA X-Received: by 10.180.39.38 with SMTP id m6mr438560wik.7.1412678198906; Tue, 07 Oct 2014 03:36:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.134 with SMTP id s6ls656644las.108.gmail; Tue, 07 Oct 2014 03:36:38 -0700 (PDT) X-Received: by 10.152.29.129 with SMTP id k1mr2563304lah.52.1412678198657; Tue, 07 Oct 2014 03:36:38 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by mx.google.com with ESMTPS id nu1si20344281lbb.77.2014.10.07.03.36.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 03:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id mk6so6088435lab.1 for ; Tue, 07 Oct 2014 03:36:38 -0700 (PDT) X-Received: by 10.112.134.229 with SMTP id pn5mr3018346lbb.22.1412678198283; Tue, 07 Oct 2014 03:36:38 -0700 (PDT) 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.130.169 with SMTP id of9csp326888lbb; Tue, 7 Oct 2014 03:36:37 -0700 (PDT) X-Received: by 10.66.222.74 with SMTP id qk10mr2773366pac.70.1412678196569; Tue, 07 Oct 2014 03:36:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oo9si15538389pbb.14.2014.10.07.03.36.35 for ; Tue, 07 Oct 2014 03:36:36 -0700 (PDT) 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 S1753064AbaJGKgR (ORCPT + 5 others); Tue, 7 Oct 2014 06:36:17 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:38623 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbaJGKgQ (ORCPT ); Tue, 7 Oct 2014 06:36:16 -0400 Received: by mail-wi0-f179.google.com with SMTP id d1so7425170wiv.0 for ; Tue, 07 Oct 2014 03:36:15 -0700 (PDT) X-Received: by 10.180.39.234 with SMTP id s10mr3365200wik.23.1412678175363; Tue, 07 Oct 2014 03:36:15 -0700 (PDT) Received: from trevor.secretlab.ca (host86-166-87-213.range86-166.btcentralplus.com. [86.166.87.213]) by mx.google.com with ESMTPSA id n5sm14228413wix.0.2014.10.07.03.36.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Oct 2014 03:36:14 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id 0EDFBC4084D; Tue, 7 Oct 2014 11:36:06 +0100 (BST) From: Grant Likely To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Grant Likely Subject: [PATCH] of/selftest: Move hash table off stack to fix large frame size Date: Tue, 7 Oct 2014 11:36:05 +0100 Message-Id: <1412678165-12087-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 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.215.42 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: , The new testcase that checks phandle consistency was using a hash table on the stack which made the frame size much large than it should be. Fix the problem by moving the hash table into the file scope. Signed-off-by: Grant Likely --- This patch applies on my devicetree/next branch, which I'm going to ask Linux to pull later this week. g. drivers/of/selftest.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/of/selftest.c b/drivers/of/selftest.c index 4fed34bff5cf..78001270a598 100644 --- a/drivers/of/selftest.c +++ b/drivers/of/selftest.c @@ -198,20 +198,19 @@ struct node_hash { struct device_node *np; }; +static DEFINE_HASHTABLE(phandle_ht, 8); static void __init of_selftest_check_phandles(void) { struct device_node *np; struct node_hash *nh; struct hlist_node *tmp; int i, dup_count = 0, phandle_count = 0; - DECLARE_HASHTABLE(ht, 8); - hash_init(ht); for_each_of_allnodes(np) { if (!np->phandle) continue; - hash_for_each_possible(ht, nh, node, np->phandle) { + hash_for_each_possible(phandle_ht, nh, node, np->phandle) { if (nh->np->phandle == np->phandle) { pr_info("Duplicate phandle! %i used by %s and %s\n", np->phandle, nh->np->full_name, np->full_name); @@ -225,14 +224,14 @@ static void __init of_selftest_check_phandles(void) return; nh->np = np; - hash_add(ht, &nh->node, np->phandle); + hash_add(phandle_ht, &nh->node, np->phandle); phandle_count++; } selftest(dup_count == 0, "Found %i duplicates in %i phandles\n", dup_count, phandle_count); /* Clean up */ - hash_for_each_safe(ht, i, tmp, nh, node) { + hash_for_each_safe(phandle_ht, i, tmp, nh, node) { hash_del(&nh->node); kfree(nh); }