From: Arnd Bergmann <arnd@arndb.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kasan-dev@googlegroups.com, Dmitry Vyukov <dvyukov@google.com>,
Alexander Potapenko <glider@google.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Arend van Spriel <arend.vanspriel@broadcom.com>,
Arnd Bergmann <arnd@arndb.de>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <mmarek@suse.com>, Kees Cook <keescook@chromium.org>,
Ingo Molnar <mingo@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
linux-kbuild@vger.kernel.org,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Subject: [PATCH v3 06/11] r820t: mark register functions as noinline_if_stackbloat
Date: Thu, 22 Jun 2017 19:13:50 +0200 [thread overview]
Message-ID: <20170622171355.267192-7-arnd@arndb.de> (raw)
In-Reply-To: <20170622171355.267192-1-arnd@arndb.de>
With KASAN, we get an overly long stack frame due to inlining
the register access function:
drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':
drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
An earlier patch I tried used an open-coded r820t_write_reg()
implementation that may have been more efficent, while this
version simply adds the annotation, which has a lower risk for
regressions.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/tuners/r820t.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index ba80376a3b86..a26d0eb64555 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -396,7 +396,7 @@ static int r820t_write(struct r820t_priv *priv, u8 reg, const u8 *val,
return 0;
}
-static int r820t_write_reg(struct r820t_priv *priv, u8 reg, u8 val)
+static noinline_if_stackbloat int r820t_write_reg(struct r820t_priv *priv, u8 reg, u8 val)
{
return r820t_write(priv, reg, &val, 1);
}
@@ -411,7 +411,7 @@ static int r820t_read_cache_reg(struct r820t_priv *priv, int reg)
return -EINVAL;
}
-static int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val,
+static noinline_if_stackbloat int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val,
u8 bit_mask)
{
int rc = r820t_read_cache_reg(priv, reg);
--
2.9.0
next prev parent reply other threads:[~2017-06-22 17:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 17:13 [PATCH v3 00/11] bring back stack frame warning with KASAN Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 01/11] compiler: introduce noinline_if_stackbloat annotation Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 02/11] netlink: mark nla_put_{u8,u16,u32} noinline_if_stackbloat Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 03/11] rocker: mark rocker_tlv_put_* functions as noinline_if_stackbloat Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 04/11] mtd: cfi: reduce stack size with KASAN Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 05/11] dvb-frontends: reduce stack size in i2c access Arnd Bergmann
2017-06-22 17:13 ` Arnd Bergmann [this message]
2017-06-22 17:13 ` [PATCH v3 07/11] tty: improve tty_insert_flip_char() fast path Arnd Bergmann
2017-06-23 16:07 ` Greg Kroah-Hartman
2017-06-26 13:58 ` Arnd Bergmann
2017-06-27 20:43 ` Arnd Bergmann
2017-06-25 2:33 ` kbuild test robot
2017-06-22 17:13 ` [PATCH v3 08/11] brcmsmac: make some local variables 'static const' to reduce stack size Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 09/11] brcmsmac: split up wlc_phy_workarounds_nphy Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 10/11] brcmsmac: reindent split functions Arnd Bergmann
2017-06-22 17:13 ` [PATCH v3 11/11] kasan: rework Kconfig settings Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170622171355.267192-7-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=arend.vanspriel@broadcom.com \
--cc=aryabinin@virtuozzo.com \
--cc=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kasan-dev@googlegroups.com \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mmarek@suse.com \
--cc=netdev@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).