From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932503AbcCDIfL (ORCPT ); Fri, 4 Mar 2016 03:35:11 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:40209 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758550AbcCDIfG convert rfc822-to-8bit (ORCPT ); Fri, 4 Mar 2016 03:35:06 -0500 X-IronPort-AV: E=Sophos;i="5.22,535,1449561600"; d="scan'208";a="268554431" X-IronPort-AV: E=McAfee;i="5700,7163,8093"; a="682907282" From: "Valo, Kalle" To: Arnd Bergmann CC: ath9k-devel , "linux-arm-kernel@lists.infradead.org" , "linux-wireless@vger.kernel.org" , "ath9k-devel@lists.ath9k.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process Thread-Topic: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process Thread-Index: AQHRZYxTwcCg/O+62kKToG9QhzCOgg== Date: Fri, 4 Mar 2016 08:34:55 +0000 Message-ID: <87mvqezln6.fsf@kamboji.qca.qualcomm.com> References: <1455278130-1831694-1-git-send-email-arnd@arndb.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.251.52.12] Content-Type: text/plain; charset="us-ascii" Content-ID: <6A681C5ED5A5CC48B8136D4B22F84318@qualcomm.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann writes: > In some configurations, this function uses more than the warning limit > of 1024 bytes: > > drivers/net/wireless/ath/ath9k/ar9003_aic.c: In function 'ar9003_aic_cal_post_process': > drivers/net/wireless/ath/ath9k/ar9003_aic.c:434:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > It turns out that there are two large arrays on the stack here, but > almost all the data in them is never used outside of the loop in > which it gets written, so we can replace the array with a single > instance. > > The .valid flag is used later, so I'm replacing the array of structures > with an array of bools. An obvious follow-up optimization would be > to replace it with a bitmask and set_bit()/find_first_bit()/ > find_last_bit()/... operations. However, I have not tested this patch, > so I sticked to the simpler transformation that does the job of > reducing the stack usage to a harmless level. > > Signed-off-by: Arnd Bergmann Applied to ath.git, thanks. -- Kalle Valo