Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1750332ybg; Sat, 19 Oct 2019 01:41:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUVRc7KVjY+wYR9tOc/85+Ink1dHPiBcvQB6ow1phnCfoZIYPVnW+/+J/qWJ+mbVOEUcYa X-Received: by 2002:a17:906:c739:: with SMTP id fj25mr871436ejb.164.1571474518763; Sat, 19 Oct 2019 01:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474518; cv=none; d=google.com; s=arc-20160816; b=MwXsLZlaA/8CcZRWMqbBpZsA+rqERlxS7F9pfsufCICwWXwLQNdxPsMNhjMGYGrlCJ NlFc39k1I8tkAz62RgIfC39y/1oP+3w53ZeYaYuoVg65BsPqY7dT9F/AH7Iu5tRBYN07 L6Ye0Zexdibqw4C2o82c/o9dNs4OeCCCXFyytVkJiYzzGsqdP9iqlPXjwiT45YGfTM4H s9LyoYSxo4GW6Ep8gfoy5BlvT+Ky+yCDl4DxIWrLleyzUtFsfA+qEfHQ66oKeXbSSrdb QNUdhKDZ6eaP5OTXM7VzURgSajHVwB3shtMCKCL2KY0tRiMZAjeAkusSlK1jGONTkBIz jeMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=lJc0hj7tQVxDAaGjfCOv7vwr1QfJ/5Ay/O35J4hdg0E=; b=ml1Nu6GjVBzXSTzZZ3q2Y5qHrZ1jdziWFytNZxvaZJ8hJ/p8ZNqef3XOfBwZtwheSP oU5GIYQxv58qxD3BUw8x9x5IdLxhs0aYa3Zj1YEiJvWa212Bws6UuDW7Cq882XkkVhRK QinnsYRJOnN4F6wMn3EWS+tPemZ1jEsAG+HxqPJaYIEWqX81g9fH/IGd3nEHOsIqZPRO imyUt1KY7EHKVL0J3PWFhgYYLFt2CT9ksQYnTJH0rrGMrgkfbmigQl3KAuPi+Zke7mat vHhJ+aoQA9Nz2ylJfQ5nnwuX9o68Zq5eB7g9ZdoLD88enloXNPchLz9Oo+CsuWp5YP17 q7bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W34HiTmz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si4880004ejw.373.2019.10.19.01.41.35; Sat, 19 Oct 2019 01:41:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=W34HiTmz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437584AbfJRQaJ (ORCPT + 99 others); Fri, 18 Oct 2019 12:30:09 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37941 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732948AbfJRQaJ (ORCPT ); Fri, 18 Oct 2019 12:30:09 -0400 Received: by mail-wr1-f65.google.com with SMTP id o15so6497661wru.5; Fri, 18 Oct 2019 09:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lJc0hj7tQVxDAaGjfCOv7vwr1QfJ/5Ay/O35J4hdg0E=; b=W34HiTmzG0Wkh8A4mK+ZBdO7Aae+UoxMX9i9O7wdsm3reQ/ZEtdu3N4gw0ACWa8nbe bpAzAeXA+eqX577RWAm+tQVEQNxRs/1GBLc1TlbBsfMvvme0U/x7Eb1DuRhjJLNIPkhe ooAQtfe2s6JHbVqwyj6nDJiDFV57IXFscjR0vUXmroN10dCjWUV2pMbbyeds/UYgy5sY zNVyoJbEmrWGwDSPlUh4BpS9OyhC0mgDHuWjGZ+CUu0rKVG7nxzrEKjihpX8SvUvsnlV URGpEeu27I3kqsfnJUqoSHj+bzMoZHrhTcGOsbC/rwnDWn6TUGXE6Y4ZY9P0ltJZgFjJ UdZg== 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; bh=lJc0hj7tQVxDAaGjfCOv7vwr1QfJ/5Ay/O35J4hdg0E=; b=Vp1Ycb7Vt1noBRj3fBkas+grtSsIyuCJlb68XVhJXQStmSRmnvvvj2V8a3kLvkJuox rYSjZLZ0sCO1dBsTd6H8WaiifTxkLDyJufS8CY8v9W06GSDeoRJsS5ypbrcafoLUuYAO uHNU1sQ3wLz7QZA5zXkj/haeT5pnBpNJOQhqz1k7Aa+YI6R7TxRd5FgyaJUBgIaf3vGK vH21RA8fGvN2r549IVBKWtsubvt5vl+RIHdlZFGf6P47vcf20UzH1Zz67fmoeUWzXyTn UYHw1ma5SaapZGO0nNr0731Fxx8IiiH8JhO3z95nUhY89w2hde6wlheSB9Vzrdi1npxn wSfw== X-Gm-Message-State: APjAAAV5K+sL8mQKAX9BLW7jtK4zW+IBDie/GXeiLJxijCpAGfCrdiE6 KVobB3zG/9pKhQrjCy0nbgw= X-Received: by 2002:a5d:484e:: with SMTP id n14mr8206328wrs.110.1571416206126; Fri, 18 Oct 2019 09:30:06 -0700 (PDT) Received: from debian.office.codethink.co.uk. ([78.40.148.180]) by smtp.gmail.com with ESMTPSA id m16sm5010123wml.11.2019.10.18.09.30.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2019 09:30:05 -0700 (PDT) From: Sudip Mukherjee To: Bartlomiej Zolnierkiewicz Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee Subject: [PATCH] omapfb: reduce stack usage Date: Fri, 18 Oct 2019 17:30:04 +0100 Message-Id: <20191018163004.23498-1-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The build of xtensa allmodconfig is giving a warning of: In function 'dsi_dump_dsidev_irqs': warning: the frame size of 1120 bytes is larger than 1024 bytes Allocate the memory for 'struct dsi_irq_stats' dynamically instead of assigning it in stack. Signed-off-by: Sudip Mukherjee --- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index d620376216e1..43402467bf40 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -1536,22 +1536,25 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, { struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); unsigned long flags; - struct dsi_irq_stats stats; + struct dsi_irq_stats *stats; + stats = kmalloc(sizeof(*stats), GFP_KERNEL); + if (!stats) + return; spin_lock_irqsave(&dsi->irq_stats_lock, flags); - stats = dsi->irq_stats; + memcpy(stats, &dsi->irq_stats, sizeof(*stats)); memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); dsi->irq_stats.last_reset = jiffies; spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); seq_printf(s, "period %u ms\n", - jiffies_to_msecs(jiffies - stats.last_reset)); + jiffies_to_msecs(jiffies - stats->last_reset)); - seq_printf(s, "irqs %d\n", stats.irq_count); + seq_printf(s, "irqs %d\n", stats->irq_count); #define PIS(x) \ - seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]); + seq_printf(s, "%-20s %10d\n", #x, stats->dsi_irqs[ffs(DSI_IRQ_##x)-1]); seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); PIS(VC0); @@ -1575,10 +1578,10 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, #define PIS(x) \ seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \ - stats.vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); + stats->vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); seq_printf(s, "-- VC interrupts --\n"); PIS(CS); @@ -1594,7 +1597,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, #define PIS(x) \ seq_printf(s, "%-20s %10d\n", #x, \ - stats.cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); + stats->cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); seq_printf(s, "-- CIO interrupts --\n"); PIS(ERRSYNCESC1); @@ -1618,6 +1621,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, PIS(ULPSACTIVENOT_ALL0); PIS(ULPSACTIVENOT_ALL1); #undef PIS + kfree(stats); } static void dsi1_dump_irqs(struct seq_file *s) -- 2.11.0