From patchwork Tue Feb 19 17:01:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 158723 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3891346jaa; Tue, 19 Feb 2019 09:02:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IZZxpA4aT/6wDAGlUsSg61Wdh7P261SuVRpJJ2p07zcKcy5x8WUo7n8+27/8TfpkTXz69h3 X-Received: by 2002:a62:4414:: with SMTP id r20mr30517931pfa.37.1550595746681; Tue, 19 Feb 2019 09:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550595746; cv=none; d=google.com; s=arc-20160816; b=MjklnZMGJqezRJ3vKzEAcRowmqrhQyetAfQmtONKUwl+V8Kcx9jEmy07X1U8VYOVUC wRChJ0TGRTdsS6DlYS7oPcIoR851GwvZtKnzIjaNSCSlABW86j19gVsj4wWYFAuycaSY thY6RHuNDbfRER6UxTeNo2oLVvlwUU6rI3WVd+lM7jCmB/tFYeG9cgfY2mua/srDeMn+ vaUN4iwHYA4oJe4/nHrCSeonWBR7cw/3z1yfCa1Kzjvg9NuAppt0mWUZRkzeq2Kwhmeu tfl241nGI1ieFp56tdwE9zuy/7qPfGF2oQ119NGlnsHzA10EzYBZIIvVJLQyR8XvbD9K 0SOg== 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; bh=dkxq09Un7bvd/IJEE2ShYwsphMXOH4LcH10dJgGBWbA=; b=vhCKCJ7WbMwFRksJszfpZ6EAOuut1izUTOGpCzu809MacZsrGzo5S07+3MJQx6Xi43 gUYYWpD5RRiArndD5cJDDi+pN+p4HU9gdjdDP5vSmHOZq4SVkjrPQ1MILblyr/bxo3Ud ONR8GszE6dO0lHXPa5EUCAPyp7JS2ir3uIP4bj7m05498YbzLSa3V25+Ol0Rr9YC7PdI J9oIVjGNMN8NpWtQ1x6lw5CHB/CkwdecEJHZoCfOhd9cgDpXYY/Yh2fd2M3COx5pcYwj 0c5cLqGrfp3i2f6D5PWGLduUK1jitmX8axfcE16QEA/V9yO+9pw4+dRTjY1U9Zu3N+sI 1Dyw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si16312208pgc.290.2019.02.19.09.02.26; Tue, 19 Feb 2019 09:02:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729622AbfBSRCY (ORCPT + 32 others); Tue, 19 Feb 2019 12:02:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:58081 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729574AbfBSRCW (ORCPT ); Tue, 19 Feb 2019 12:02:22 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MF3Y8-1gpUx110si-00FOyH; Tue, 19 Feb 2019 18:02:11 +0100 From: Arnd Bergmann To: Hans Verkuil , Mauro Carvalho Chehab Cc: Nick Desaulniers , Mark Brown , Nathan Chancellor , Arnd Bergmann , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] media: saa7146: avoid high stack usage with clang Date: Tue, 19 Feb 2019 18:01:56 +0100 Message-Id: <20190219170209.4180739-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:f17Grli5DiRWtm73DDP6MNHKjIcKP4kUCt8yTLp1WethQDw9LhW qv86EcVZ/81xQ0kMCKXjaTBoXe5EdOh41HcBu5xWyUC2y7BFAftViI8ub9GwaSCBNDN0uPW 5pI9Jt4lbcbCyGrRFCjeKsXR2CtrWzoZKAmSxU+Xb4U01pEzkoCRPJrmPmyD5H43DTQVwN9 L7Ecjvy/jLZUkdyu0kPGQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:57pD253Ows8=:gcY+mv6OFOSjxIulmh/3Jw cEouaU5dMvs1jIrYO8aOahIOtngKiWVd/mMZHUlHXbjipUQxAP52lRYQug3vsFyE1iaixK58c rg+kXHvDqKlbosy316li/b+UoIQKYRP54s/ckL8kfj5/UCX3IICntAAOaEeWSuIStaBEN9EGR JjUcfAejsssIgnkVhujdW2lEVaV4yUMajz9PElOvsJfd2rcur8Lcxx/8gJYMUlSHWfr4TxNMr tw41a1M1236lAJaiDAK3x6kiEdVjovE2G/Bu1IbdF8u7HfR0D3b1oJRijZURHdWdbwLJNkDrZ l6A/fx/8KGQvimSEUyfTiolG4ThpVE8n5OZkuMJzCsabWxaaUa1B9ke9O1nJMYowM7hD2W/tH 5eiK1siQmUwCoN4WVioZfwZOFJPemBNWtCoePKuG+OwwJ94okVajNlSMA8jRw9FXBUevfY909 ARMXbxhcW6LgUb8URBzFAzktp1Ali0IERlCxetQkGDtE+FI7CEFnD/9AmmdWLZavFmsitO23C zSywski7VY0C1IOLVogZRBv0u6r9QiBoZ6Sqokrby2Tyn7Y5GRZNe/y9yzeKg3HwjRm7W96uR wIAhF12t/G5bB11xaJ0ytt/lgO/uJVfPpUyzpxtazjHCdbT05GUasNwMDDwpICtd+86DiDuNH TEqPmK1kKXDo7ryTBrM1CK8F01zBThcL6A+g07sKO2FYFtF0QYdYxqwWtSOaMWdqP5JU9QehE y8lYGj1Pis+RTS5NT6KqZFFgoWAD1vw8ge737w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two saa7146/hexium files contain a construct that causes a warning when built with clang: drivers/media/pci/saa7146/hexium_orion.c:210:12: error: stack frame size of 2272 bytes in function 'hexium_probe' [-Werror,-Wframe-larger-than=] static int hexium_probe(struct saa7146_dev *dev) ^ drivers/media/pci/saa7146/hexium_gemini.c:257:12: error: stack frame size of 2304 bytes in function 'hexium_attach' [-Werror,-Wframe-larger-than=] static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info) ^ This one happens regardless of KASAN, and the problem is that a constructor to initalize a dynamically allocated structure leads to a copy of that structure on the stack, whereas gcc initializes it in place. Link: https://bugs.llvm.org/show_bug.cgi?id=40776 Signed-off-by: Arnd Bergmann --- drivers/media/pci/saa7146/hexium_gemini.c | 4 +--- drivers/media/pci/saa7146/hexium_orion.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) -- 2.20.0 Reviewed-by: Nick Desaulniers diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index 5817d9cde4d0..f7ce0e1770bf 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c @@ -270,9 +270,7 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d /* enable i2c-port pins */ saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); - hexium->i2c_adapter = (struct i2c_adapter) { - .name = "hexium gemini", - }; + strscpy(hexium->i2c_adapter.name, "hexium gemini", sizeof(hexium->i2c_adapter.name)); saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480); if (i2c_add_adapter(&hexium->i2c_adapter) < 0) { DEB_S("cannot register i2c-device. skipping.\n"); diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c index 0a05176c18ab..b9f4a09c744d 100644 --- a/drivers/media/pci/saa7146/hexium_orion.c +++ b/drivers/media/pci/saa7146/hexium_orion.c @@ -231,9 +231,7 @@ static int hexium_probe(struct saa7146_dev *dev) saa7146_write(dev, DD1_STREAM_B, 0x00000000); saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26)); - hexium->i2c_adapter = (struct i2c_adapter) { - .name = "hexium orion", - }; + strscpy(hexium->i2c_adapter.name, "hexium orion", sizeof(hexium->i2c_adapter.name)); saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480); if (i2c_add_adapter(&hexium->i2c_adapter) < 0) { DEB_S("cannot register i2c-device. skipping.\n"); From patchwork Tue Feb 19 17:01:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 158724 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3891660jaa; Tue, 19 Feb 2019 09:02:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IZOggsSgb9x5INmVs5vLRsNeeni6g+Hz7ul7chITqn4vojKQxEWTckiHiYPB2+mdE7rESBt X-Received: by 2002:a65:4b83:: with SMTP id t3mr24763043pgq.417.1550595763599; Tue, 19 Feb 2019 09:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550595763; cv=none; d=google.com; s=arc-20160816; b=lxL0xNAdsEMU5IC5IMEs070dsjXGHpl/0KRVMKFvT5RlfpaGYqzwmudJQ2zpxOZqXS 9yi3AnA6yDjtrdSeRyyj/hKGwlk1VMtj5qcPTk85OvV1tpiG1VT2qlDiPRl1cfMioGeW QR7qWcxIL+DfRrpyA++4L/l6mgo30Vh/8bMJFENRwpPcDbtaurX3Cd7zPShJs2ONOpIQ cgJtbrbfYDWRtxFpP2Xm4/nYt65f01p05gw/5lg4zcYsytkkhH06/BTS06Pb2WP7k3YJ vUKKR9a3VFm2b7uplhjkmGyZX5mmrykJMpmg17IgWPZ3PgpiWyCJKidK7stVZ56e0Rc5 uLqQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jqJ81/GD1xuVTEoMvATVw+E5IibXvsXhAgWxHz1EGjc=; b=tPLcvbh6d59VkiSAQSnOcFbbUMeyMIqGHtCtNUVEzBWw46US8pl6yYeTai8Q1rf3tQ PtJSQLK0Iu4q9ji+WUNWhveaL9MFjxFWvgwzXtnV0f7KE/VLKjcBm5mWQtqt1YbipoYj wCFAV4ug550n1pedVQwqc3fr/jSYTMgonLUvs3i4BXa9AYpJbWrIPgY1MkRE93J7zxGN 7ZuxLS8JuBTwKkHn27OUSeXB2YEzmJBC7ly03n4VArsPd6mSz3wXD9rpGeiQ0P08UHa8 iGvVxJBPtqlQbkGVmbBSkSHA1iVIbh3xQtSOC2XtXklc7s0W/PEVW0GUt2EtY/NzI2ni gc5Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si14823535pfb.282.2019.02.19.09.02.43; Tue, 19 Feb 2019 09:02:43 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729305AbfBSRCm (ORCPT + 32 others); Tue, 19 Feb 2019 12:02:42 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:41431 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbfBSRCj (ORCPT ); Tue, 19 Feb 2019 12:02:39 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1N1g3U-1h2v7v0rTE-0121Q1; Tue, 19 Feb 2019 18:02:31 +0100 From: Arnd Bergmann To: Hans Verkuil , Mauro Carvalho Chehab Cc: Nick Desaulniers , Mark Brown , Nathan Chancellor , Arnd Bergmann , Dafna Hirschfeld , Tom aan de Wiel , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] media: vicodec: avoic clang frame size warning Date: Tue, 19 Feb 2019 18:01:57 +0100 Message-Id: <20190219170209.4180739-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190219170209.4180739-1-arnd@arndb.de> References: <20190219170209.4180739-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:g3znxI/S5xnDkg9Wo/D5wh5t5Hsi2OmQeyEHXvKEecfS9DuX84+ nY1feFvodvSCf3T+Iq/YOia9EwfUqYXvmR7TgseZOfxNmKk/1XgqE5pPLzwWEYQkmqC+h+J TpRBpS5grwf9zvHmB3wkDZc4pG3yk1uzCQ1ymjBWJIS0dEPFGKE0LbK3zMdoiY5He+dQTDI ogBqLHSjrrQVq8o0FnGZQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:NjfAPwaaOKc=:GfqSa4Qkn5dajg+UW9UJm8 xhxtplujGY28bIVix3xacsMgHfW0xT0G/CV9Vf6BDeWkUvUiSYvfOYeZOlx05igtmixda2MoE v0NajU7//WYKQj5X+D4ZgJT8+i1mKIgAYM8IURdJhhNreyrWghF/CK+w0WJOPQKEN2Xk8xpVt IRfaiQFkSRZw91at/GguaxdIXM6u7l88aWRiWskbb1e0CyQMuzj80lkwLI62MYYkVtT0FIYRX bv+EFnUVrmUSfZetZyirHIuc5B/fzbs4cnlLZnmzhIMuo50gq1J02TYmFnvUD+xaRfGowkJw3 1pDsCqr1Zhrhi19w+EKmmQQLQZxIClV6urxEXlsVsrQW05vfxynwJGDtZXDE3JpqQTQ4DJeFd aYlBb+EsJoIKZXQu0GhHq8y5j82tGDaVDWpGgQiD72bBOllq4aM1iw2bkC5ION0JrR0+IYUFy pP07acz9PzNeMWGdL18fIpZAH/7LwrAwcFlZli3mdldlfHnkOA/fhU3y4WkHdiixUkRVTD8Pj m9+DKUQ/+59dCxLYi7baGl61636ttT87d3LuXyyp+JcVg3posMFSbExp9cUnVtRjdXgDHM3fS IiEiX8IXfVG5/odYvO+e0HmtBZyx7iwZYecLbN1Yr8Zcqn1Yqghlp9pJEuPAMA+dT9z+K/zRz c02B/dZcEyDvEVyEIe8c0NI3cGjpVDp6PCWdHBIhVTGi7+j62tAfPYi2pM6xAff8lv+B6M2vt Oh2TOUGeLFsPHNy/pe2EzpK8VOLhPmtaImUnHw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang-9 makes some different inlining decisions compared to gcc, which leads to a warning about a possible stack overflow problem when building with CONFIG_KASAN, including when setting asan-stack=0, which avoids most other frame overflow warnings: drivers/media/platform/vicodec/codec-fwht.c:673:12: error: stack frame size of 2224 bytes in function 'encode_plane' Manually adding noinline_for_stack annotations in those functions called by encode_plane() or decode_plane() that require a significant amount of kernel stack makes this impossible to happen with any compiler. Signed-off-by: Arnd Bergmann --- drivers/media/platform/vicodec/codec-fwht.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) -- 2.20.0 diff --git a/drivers/media/platform/vicodec/codec-fwht.c b/drivers/media/platform/vicodec/codec-fwht.c index d1d6085da9f1..135d56bcc2c5 100644 --- a/drivers/media/platform/vicodec/codec-fwht.c +++ b/drivers/media/platform/vicodec/codec-fwht.c @@ -47,7 +47,7 @@ static const uint8_t zigzag[64] = { }; -static int rlc(const s16 *in, __be16 *output, int blocktype) +static int noinline_for_stack rlc(const s16 *in, __be16 *output, int blocktype) { s16 block[8 * 8]; s16 *wp = block; @@ -106,8 +106,8 @@ static int rlc(const s16 *in, __be16 *output, int blocktype) * This function will worst-case increase rlc_in by 65*2 bytes: * one s16 value for the header and 8 * 8 coefficients of type s16. */ -static u16 derlc(const __be16 **rlc_in, s16 *dwht_out, - const __be16 *end_of_input) +static noinline_for_stack u16 +derlc(const __be16 **rlc_in, s16 *dwht_out, const __be16 *end_of_input) { /* header */ const __be16 *input = *rlc_in; @@ -373,7 +373,8 @@ static void fwht(const u8 *block, s16 *output_block, unsigned int stride, * Furthermore values can be negative... This is just a version that * works with 16 signed data */ -static void fwht16(const s16 *block, s16 *output_block, int stride, int intra) +static void noinline_for_stack +fwht16(const s16 *block, s16 *output_block, int stride, int intra) { /* we'll need more than 8 bits for the transformed coefficients */ s32 workspace1[8], workspace2[8]; @@ -456,7 +457,8 @@ static void fwht16(const s16 *block, s16 *output_block, int stride, int intra) } } -static void ifwht(const s16 *block, s16 *output_block, int intra) +static noinline_for_stack void +ifwht(const s16 *block, s16 *output_block, int intra) { /* * we'll need more than 8 bits for the transformed coefficients @@ -604,9 +606,9 @@ static int var_inter(const s16 *old, const s16 *new) return ret; } -static int decide_blocktype(const u8 *cur, const u8 *reference, - s16 *deltablock, unsigned int stride, - unsigned int input_step) +static noinline_for_stack int +decide_blocktype(const u8 *cur, const u8 *reference, s16 *deltablock, + unsigned int stride, unsigned int input_step) { s16 tmp[64]; s16 old[64]; From patchwork Tue Feb 19 17:01:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 158725 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3891847jaa; Tue, 19 Feb 2019 09:02:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IZquR/dOvFI2Jh5pisZ158R+ZYjBO7YtGFscSQvBpvYMW9JIgEMdmychNUswus2BvokIwKB X-Received: by 2002:a17:902:7686:: with SMTP id m6mr23198972pll.262.1550595771710; Tue, 19 Feb 2019 09:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550595771; cv=none; d=google.com; s=arc-20160816; b=yPvdsXWZiCprqJ60lxO/u/CzjxcKFE4bR6uieyz4nIBRl4IBOAbtJXAx6TN7pT87bJ rMleZovXO1N5CdTuqkM1xMmP7UIAXJm14dhYyVca2AUeWqi1eD4VzyH4eENU57lFMgNz 9Ua9Pg+Ket2CmyQEfGT48kxJjujlVSl74jdtz5NGRPswGLkz5Hbso3cFidm58O3IFITd hoPQBVet90WLJgNOyNZAnsLj+YlDaQjOWTmt1L9PU+x8pOxB0i47QnM/SZ/20rmA3gmM SU9Qw/CE5xALjJibpOVlsO7NWxi55gtWkgXw2d+wt13G8h+Yq4PSMn6PlESoy2DhKb1I JBFA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=18tu/SEQI4rktR04YViNcj0GJKEHcDkMaBLXa8IPqqc=; b=aPPvrIug/414SxSBJqifGx/oRi5nwio2hq+A2/EuUYMgLz3ojhgXXpnYnRBMDsNMA5 e2dcx6wDaroyr5sYldein7IXa6PqLBfGFVlWVCbrHn1E0jzXF5BAvXXxfol61rMMZMZo 2XMkHoDv4aIPmcHFmTHgIBFDE1qfkwRlYAOqOZQB3r+T50Yz5ID7UwaZI+o1iYkuykAK IioYXCsEGI3oxKYU4GRuOM9dkex0+dxgou7i8KOt6Hw0Q+iulYyNpQnRfTHOqzuSSPqt MS5g/jEa8kqbstbS/5M0hjuF+CL1DWVReWsRBLINSVSKkPwouqkpi1o2c3OFmpp701F8 qI1A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f40si17835828plb.60.2019.02.19.09.02.50; Tue, 19 Feb 2019 09:02:51 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbfBSRCt (ORCPT + 32 others); Tue, 19 Feb 2019 12:02:49 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:37909 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbfBSRCr (ORCPT ); Tue, 19 Feb 2019 12:02:47 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1N8GhM-1h9Uhq43Oq-014DH7; Tue, 19 Feb 2019 18:02:39 +0100 From: Arnd Bergmann To: Hans Verkuil , Mauro Carvalho Chehab Cc: Nick Desaulniers , Mark Brown , Nathan Chancellor , Arnd Bergmann , Kees Cook , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] media: go7007: avoid clang frame overflow warning with KASAN Date: Tue, 19 Feb 2019 18:01:58 +0100 Message-Id: <20190219170209.4180739-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190219170209.4180739-1-arnd@arndb.de> References: <20190219170209.4180739-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:t3/mjdv6wD7/tRWMcKiA8p4QjJ/EUzxVvcV1M/rdrL5rgjq1TlX KfM4Vr+jOGWw+vH4oZ7k1IcyafTsF90+y1m/tMfUKBnkDiaa/2yMXP2B9gOm5Fbkd31+KGT qyguvIHRu6rqgEIjRJTeXaNL6r+iLIEEEOHgb9HyZi4zPeAOuusvzc+Ph7yE9LUOJ5oFRfG FLaHWGwMZkWJgJVrylW8w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:/iscvYMUj2s=:D6jkiQZZlLvU2DbWwLGRka s/wTwku8APxSue3R5LdgNBEeW9OYL6Y4YYeXdUUrv01//8VCHSopg3kmQ5VbaPXW6R1VsFk30 yaxuWQ/zaR4FmTqAtBJvGVgtxiHg6+eBDilyn6p1hHEbwK//Hyj0/fL0Ti+Qh/SR3xf+nqRT5 qgfmtJ/E7L2OwVyacTkuf+bLU08lZq7dD66X5SX9H5KJzhWnswOhRLCiPwZ2chD6+Jd3HFqJl aHWB0GycawCgV+pUkgxAAy5zKfMZEG4saQZfIgYV9AaD5Lgw50A6RkbtCTI+opV/vjcsR4D44 IEUZoSARl8wUa2+FMGYsb8GJ0jQsrhpJIWJQnt1OIQTtTEiOYR0875WhFWlknhdxYKGBOHFqz kAkkUKgiPjtMcZ9SpZg2yhvZBJx2iniRcjoj1v5oGPfXk+RwGuqzjrC6OLwT7pU50fxtGRCE0 5fkekKDcFknmCld9FDO9QXfiEgYyJenKRGW/8rpdwUM4bWkAsVqd5my1SiPEP/iNHRbNz/ITB TF9IdZHxRKrsrhsASfAZrOB8H8XnLqIrcYeoigkPxNAqwovIft3bVpoCDXbyApuThpQspL4/6 eKQ3pARJo1MvLbBG4tuHrOjExNiN56U4z15p8iA6YeM/0ZqzH5hoYiWpWwf8ZDyoYjov8+PXR 4unNRFjTQpOewaT5x0jWXyPju9yeyirwnzdgpC1/o7ctQ+YYduPIkbiR1peY/OuxC15J9xhjD 7JOWeeO02EijN58g1iXmhgBAjGCkQutNxzVTkw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clang-8 warns about one function here when KASAN is enabled, even without the 'asan-stack' option: drivers/media/usb/go7007/go7007-fw.c:1551:5: warning: stack frame size of 2656 bytes in function I have reported this issue in the llvm bugzilla, but to make it work with the clang-8 release, a small annotation is still needed. Link: https://bugs.llvm.org/show_bug.cgi?id=38809 Signed-off-by: Arnd Bergmann --- drivers/media/usb/go7007/go7007-fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 diff --git a/drivers/media/usb/go7007/go7007-fw.c b/drivers/media/usb/go7007/go7007-fw.c index 24f5b615dc7a..c7201e93c331 100644 --- a/drivers/media/usb/go7007/go7007-fw.c +++ b/drivers/media/usb/go7007/go7007-fw.c @@ -1499,7 +1499,7 @@ static int modet_to_package(struct go7007 *go, __le16 *code, int space) return cnt; } -static int do_special(struct go7007 *go, u16 type, __le16 *code, int space, +static noinline_for_stack int do_special(struct go7007 *go, u16 type, __le16 *code, int space, int *framelen) { switch (type) {