From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751791AbdBCALl (ORCPT ); Thu, 2 Feb 2017 19:11:41 -0500 Received: from smtprelay0240.hostedemail.com ([216.40.44.240]:48769 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751500AbdBCALk (ORCPT ); Thu, 2 Feb 2017 19:11:40 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:4321:5007:6119:8603:10004:10400:10848:11026:11232:11658:11914:12043:12296:12663:12740:12760:12895:13069:13141:13230:13311:13357:13439:14659:14721:21080:21451:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: jail53_6574719b6d746 X-Filterd-Recvd-Size: 2748 Message-ID: <1486080687.22276.59.camel@perches.com> Subject: Re: [PATCH] staging: fbtft: change 'gamma' array to u32 From: Joe Perches To: Arnd Bergmann , Greg Kroah-Hartman Cc: Thomas Petazzoni , Noralf =?ISO-8859-1?Q?Tr=F8nnes?= , Anson Jacob , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 02 Feb 2017 16:11:27 -0800 In-Reply-To: <20170202144544.3680633-1-arnd@arndb.de> References: <20170202144544.3680633-1-arnd@arndb.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-02-02 at 15:43 +0100, Arnd Bergmann wrote: > Having a local variable of 1024 bytes on 64-bit architectures is a bit > too much, and I ran into this warning while trying to see what functions > use the largest stack: > > drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve': > drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] > > As there is no need for 64-bit gamma values (on 32-bit architectures, > we don't use those either), I'm changing the type from 'unsigned long' > to 'u32' here, which cuts the required space in half everywhere. [] > diff --git a/drivers/staging/fbtft/fb_hx8347d.c b/drivers/staging/fbtft/fb_hx8347d.c [] > @@ -102,7 +102,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) > * VRN0 VRN1 VRN2 VRN3 VRN4 VRN5 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 CGM > */ > #define CURVE(num, idx) curves[num * par->gamma.num_values + idx] > -static int set_gamma(struct fbtft_par *par, unsigned long *curves) > +static int set_gamma(struct fbtft_par *par, u32 *curves) > { > unsigned long mask[] = { > 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7f, 0x7f, 0x1f, 0x1f, presumably these should be static const and maybe u8 or u32 too > diff --git a/drivers/staging/fbtft/fb_ili9163.c b/drivers/staging/fbtft/fb_ili9163.c [] > @@ -202,7 +202,7 @@ static int set_var(struct fbtft_par *par) > > #ifdef GAMMA_ADJ > #define CURVE(num, idx) curves[num * par->gamma.num_values + idx] > -static int gamma_adj(struct fbtft_par *par, unsigned long *curves) > +static int gamma_adj(struct fbtft_par *par, u32 *curves) > { > unsigned long mask[] = { > 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, etc...