From patchwork Tue Feb 14 21:28:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9572947 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D0F1601E7 for ; Tue, 14 Feb 2017 21:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D87D26CFF for ; Tue, 14 Feb 2017 21:29:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41E0826E4D; Tue, 14 Feb 2017 21:29:19 +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=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 E806626CFF for ; Tue, 14 Feb 2017 21:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755633AbdBNV3B (ORCPT ); Tue, 14 Feb 2017 16:29:01 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:61713 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbdBNV3A (ORCPT ); Tue, 14 Feb 2017 16:29:00 -0500 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LtRci-1cEU0j3wTE-010sbJ; Tue, 14 Feb 2017 22:28:50 +0100 From: Arnd Bergmann To: Stanislaw Gruszka , Helmut Schaa , Kalle Valo Cc: Arnd Bergmann , Mathias Kresin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rt2500usb: don't mark register accesses as inline Date: Tue, 14 Feb 2017 22:28:33 +0100 Message-Id: <20170214212846.2809141-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:YghB9z7/4wsZ+FuwGb5TXyUhzbGvlD9L8QK0XY/3FaQYqGd6gWg 4YlMEOHlTYEoJ7hU0+MVl/p9QnCcvZUxlsDjt9NC/1mh/Nse3eqKdYwApLRtqzg6q/wa6IH c855QjDZeRG9NVVL1XLYJ19Hkxjk0hUUQEa+lfQBItw1SWqu6e3owq6ZUqQm46FiYOrt+V0 0+Fc2OXfZSwoXMISM/V9w== X-UI-Out-Filterresults: notjunk:1; V01:K0:YhEplF0PvdQ=:rtys8K3fA1nN9MV//VFUnN AqWrZE7bQPTrN1DGAspgngF0wR7o8i/qS/ezHxuTr0UE1UaHFttolEtxIjYetRj1RU6G7JyhP z2ltjvLCBWwl6Hdld2OoO8KUMLY+mRGiuUtKtrDVvbMJU2X8Ou7I/QxpuYmLeYC24xlfJdY6c pBMfC540PwSebeziOqSIQkRZw6d4wEXsndMkN6u23TaIqLwegRLUPSXj0DUcedHmu3v7kMUQt FmkyrJMR4xRpyqPCfRVtrXAYZ96xaWdDd2RC0xeJ9FEM2hCzBejXUDnG5aGU2gUIt3LjYtAqL Dzp+qSeX0iMvO+sh8rniaCl1Fo4zUoV+d/Cl2VfVsMK6MuDJUmOuCrYk/YW7F99eAmxomCcaM f498lRGaemI2LhylFGLDI11QobHbDwQYUpjzPfgprOE+9EECHMlztrC/0NyTIReNo8Fd5hx9u he2ij5dOEUJxJIETirNxiksgkDwR93o/2gEM0jConmriCDdRzSoPzzZ3dUfWMTnHQDN3PToPJ eTwtazgWBC1cdl1jafNCcVSBnTfVZ9gPonaqKJcxfaAkUpq+cJC6s5RmpKBboHplfe4M1+ipX PQuU74qTB+T92DDH9Cv93B7wugeqptlzudXk4l5PTzaBoDAncthclK80zzHFT6zSKNS9C20PY 15+VVZqDfSOQsuT+rBzpgHzwjZQCf1AOYrsagCnIVq0/qTA4y8T6AzVK6tGbGzDttUcM= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_KASAN is set, we get a rather large stack here: drivers/net/wireless/ralink/rt2x00/rt2500usb.c: In function 'rt2500usb_set_device_state': drivers/net/wireless/ralink/rt2x00/rt2500usb.c:1074:1: error: the frame size of 3032 bytes is larger than 100 bytes [-Werror=frame-larger-than=] If we don't force those functions to be inline, the compiler can figure this out better itself and not inline the functions when doing so would be harmful, reducing the stack size to a merge 256 bytes. Note that there is another problem that manifests in this driver, as a result of the typecheck() macro causing even larger stack frames. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ralink/rt2x00/rt2500usb.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c index 62357465fe29..0d2670a56c4c 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500usb.c @@ -55,7 +55,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); * If the csr_mutex is already held then the _lock variants must * be used instead. */ -static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev, +static void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset, u16 *value) { @@ -66,7 +66,7 @@ static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev, *value = le16_to_cpu(reg); } -static inline void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev, +static void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset, u16 *value) { @@ -77,16 +77,7 @@ static inline void rt2500usb_register_read_lock(struct rt2x00_dev *rt2x00dev, *value = le16_to_cpu(reg); } -static inline void rt2500usb_register_multiread(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, - void *value, const u16 length) -{ - rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, - USB_VENDOR_REQUEST_IN, offset, - value, length); -} - -static inline void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev, +static void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev, const unsigned int offset, u16 value) { @@ -96,7 +87,7 @@ static inline void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev, ®, sizeof(reg)); } -static inline void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev, +static void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset, u16 value) { @@ -106,7 +97,7 @@ static inline void rt2500usb_register_write_lock(struct rt2x00_dev *rt2x00dev, ®, sizeof(reg), REGISTER_TIMEOUT); } -static inline void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev, +static void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev, const unsigned int offset, void *value, const u16 length) {