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: 158804 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4797070jaa; Wed, 20 Feb 2019 03:14:49 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia32ErJrTF/pthCSKihZE2G/EBuyERxWWrRreveRQ+gyrD6+j2YmztGLqKycuRqUihige75 X-Received: by 2002:aa7:8392:: with SMTP id u18mr34338929pfm.59.1550661289714; Wed, 20 Feb 2019 03:14:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550661289; cv=none; d=google.com; s=arc-20160816; b=Cfzbcm5BBOMCV3pdEDg5CMSBTX0CTI49LbNPifQL+jOQNyvpHnylUYNCgTER05mcet IEqlZT9LkRcHy2rkymIawaUKmp/ytLneRPn1G4MWIyoAYl1qrCoKko1CevAs/edy47oF EOxsk72pWy9Oth3kzwlqaDqpuxOvqs2gldQ19gQGBVYDbM5dkn3aEmTSr3zavc+XpVHc a797gbkA+PNCCwZ3vYl2HReYaGxqeFhw6n2BOM5YHNenAAksfHIb6hYtYZWbLiiI7Cmd /J92SfJ3zNQ9TjTEr/zQA9W+FKh9qVHkUDriWpZ/WP922jvBfEJ5SvtuBymPn9MJ8ejR 6tmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iaqe+2N11xxQ/51ku7yTu4pfL9uKnGF6QH2aPr+JL+8=; b=RXuCbPjs82KVNwfiYoNDKNXsQ4m49TDenDODwWf9mxMW8+pR+ih7aXPTpQQRrHfUE2 tmYVuVaVX/IL3PvbsgfS8wtn0dO2DJtqKUUZx96ApPACwS7I/HQElkirqPSsISKYUXrr 6w2MnwZ3DXoDk8vFW/hgMKsRPXdawwjcVvjr3aN92ua5u45f4wTZx+xihwlNi3psmj/d ou5WNUmtDFQFgR+G226ldo2aStrBzj7phvOBIetaA3eKaGZXztQsw2uDohxXAV2KFpMx U/YhQ8E/IzUOhljELfhj7MbJVCcZVzpWVMpjgTa55daJSuS4zzc4zDjiVLMCSY5zdPOl mnEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=og5UyRnk; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az4si14156623plb.231.2019.02.20.03.14.48; Wed, 20 Feb 2019 03:14:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=og5UyRnk; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbfBTLOs (ORCPT + 11 others); 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-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 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 --- drivers/cpufreq/qcom-cpufreq-kryo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.21.0.rc0.269.g1a574e7a288b Reviewed-by: Arnd Bergmann Reviewed-by: Amit Kucheria 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; }