From patchwork Wed Feb 20 11:14:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10821853 X-Patchwork-Delegate: viresh.linux@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D5B66CB for ; Wed, 20 Feb 2019 11:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75B702C275 for ; Wed, 20 Feb 2019 11:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 698C82C44A; Wed, 20 Feb 2019 11:14:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFE62C275 for ; Wed, 20 Feb 2019 11:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbfBTLOs (ORCPT ); Wed, 20 Feb 2019 06:14:48 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37164 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727748AbfBTLOr (ORCPT ); Wed, 20 Feb 2019 06:14:47 -0500 Received: by mail-pf1-f194.google.com with SMTP id s22so11771518pfh.4 for ; Wed, 20 Feb 2019 03:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iaqe+2N11xxQ/51ku7yTu4pfL9uKnGF6QH2aPr+JL+8=; b=og5UyRnkhlV9llFi7vejwdCM0lQPQL7Xsrjhd48nSur5qfwOi3p+pko43dxXnVq7vF FTAlniLcJnNphS7aJcPwUpVKq73kaMe3ntLQGv4VFVjD/rexShoDI5t68xxccJ4eevq9 IlFk+lrPkDJ14mHY4Mlp9r6CT3UH4Kk9GPuTxsssxcZ6bRSXfAmYR+D1r4p4LMOe/CPI Xq16GWuukpdraZwUH2Pj48Bz4paCfykdJ2hoMV8+SLmhl5yEp9DlBqiTNx2g38t6V9uQ gR11eDkkZvO+h3w1LQg4B1VXP1XvmfAh82XekCH4pv3lgIaO0aebYqhqStlU/llEYx/Z h2dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iaqe+2N11xxQ/51ku7yTu4pfL9uKnGF6QH2aPr+JL+8=; b=Ejkb46Xx4jqNbeM1JCUR1lTMRx5ybAt32b0R6HIWpjmWM9wGVAPTrGKDmkVfuCntkW ctUEujyOi2zs78BdVpq+PVE5B/unFY29KVMvMgvMRUbE59UEwFP/w8skKeL6HMn0PKLr 6jgixTnLu80Ue299jGKhfUoUtYOH4A72FOAMLHAAYzIIM/AFHgJNCllctcFNYRAmu4pu 6v7aehBNAuyOS7p2yOKjlT8sVdsumdNxtOWn6qtvofp9xc2Cc0hrMrjsIkP5ohaX5V/1 55HdgJEqmg6E9G5m1/crcQloY6Kj1abWBGLsAmxqAyK6PG7Ani8VM7/17MXk+gTLbH/u LjJw== X-Gm-Message-State: AHQUAuYLxNWHYhh7IXyL6MFxl6QxJ90GAI8zYujGcYL9w0q1dydaVN0o yuMwJd8GkARjIDPFnodNlsd49gKNPPo= X-Google-Smtp-Source: AHgI3Ia0uAPTGB87YBMXNU/vGH9cgBqTVaG+zZo0RBmwGiaEHSw4ccWKTerTkSqEx76adX7Y+Lw6cw== X-Received: by 2002:a63:bf4c:: with SMTP id i12mr28881675pgo.382.1550661286342; Wed, 20 Feb 2019 03:14:46 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id f14sm20767148pgv.23.2019.02.20.03.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 03:14:45 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ilia Lin Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Arnd Bergmann , amit.kucheria@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: kyro: Reduce frame-size of qcom_cpufreq_kryo_probe() Date: Wed, 20 Feb 2019 16:44:34 +0530 Message-Id: <5919a74b74f466e803e07f70136517119dcd4560.1550661235.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With the introduction of commit 846a415bf440 ("arm64: default NR_CPUS to 256"), we have started getting following compilation warning: qcom-cpufreq-kryo.c:168:1: warning: the frame size of 2160 bytes is larger than 2048 bytes [-Wframe-larger-than=] Fix that by dynamically allocating opp_tables and freeing it later. Compile tested only. Signed-off-by: Viresh Kumar Reviewed-by: Arnd Bergmann Reviewed-by: Amit Kucheria --- drivers/cpufreq/qcom-cpufreq-kryo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c index 1c8583cc06a2..6888cb6db2ef 100644 --- a/drivers/cpufreq/qcom-cpufreq-kryo.c +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c @@ -75,7 +75,7 @@ static enum _msm8996_version qcom_cpufreq_kryo_get_msm_id(void) static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) { - struct opp_table *opp_tables[NR_CPUS] = {0}; + struct opp_table **opp_tables; enum _msm8996_version msm8996_version; struct nvmem_cell *speedbin_nvmem; struct device_node *np; @@ -133,6 +133,10 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) } kfree(speedbin); + opp_tables = kcalloc(num_possible_cpus(), sizeof(*opp_tables), GFP_KERNEL); + if (!opp_tables) + return -ENOMEM; + for_each_possible_cpu(cpu) { cpu_dev = get_cpu_device(cpu); if (NULL == cpu_dev) { @@ -149,6 +153,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) } } + kfree(opp_tables); + cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0); if (!IS_ERR(cpufreq_dt_pdev)) @@ -163,6 +169,7 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) break; dev_pm_opp_put_supported_hw(opp_tables[cpu]); } + kfree(opp_tables); return ret; }