Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752710AbdFNVVK (ORCPT ); Wed, 14 Jun 2017 17:21:10 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:58098 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbdFNVVH (ORCPT ); Wed, 14 Jun 2017 17:21:07 -0400 From: Arnd Bergmann To: Andrew Morton Cc: kasan-dev@googlegroups.com, Dmitry Vyukov , Alexander Potapenko , Andrey Ryabinin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Arend van Spriel , Arnd Bergmann , Mauro Carvalho Chehab , Max Kellermann , linux-media@vger.kernel.org Subject: [PATCH v2 07/11] r820t: mark register functions as noinline_if_stackbloat Date: Wed, 14 Jun 2017 23:15:42 +0200 Message-Id: <20170614211556.2062728-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170614211556.2062728-1-arnd@arndb.de> References: <20170614211556.2062728-1-arnd@arndb.de> X-Provags-ID: V03:K0:W+qASqLecJdV3n3QI71L+Fbnp+HBFaIA3Q1KKOUu75zpaVCI+wB 8VdInnNjpj1sPaHoiqRE8uG7HHfTszWKX5zxozpMc8sN/G/Y80LWoW2xzpf4/u1n2L/x8vw RI0JgT5B7vksICgrP/Qv6Q6pgKWyTRXh0hqCVDSvnixX7JKOCNu/H+jqDr0D2chiFagY15n x0pMygzZ6jj+/djbP9GJg== X-UI-Out-Filterresults: notjunk:1;V01:K0:8UUQ1BzEd/I=:KnY9wf0pJvHTGM4fxS70K5 gtTgwjrlsLKk6enaWx+QMycml4Z8JjSDCi+tBzBiAiXztgkHiCrFPVZ7n+sn1w6xgEZ06odBQ 6qmPaUUrghPjYZi1efZ7xoo8zBq7LF77yYw2ot4eQOYfE+yVQo02DBG+XLuZ4OK47OjE4yX30 fU2YR+NwO4GjhM43H4wugLPzx7rOr1XePl7yVfoQK0h/Igpdw2qHyDRDVtQahWhX5m6kYJXB4 zgU1/l8ZiAzA2JB8LGUEYXLJnmK0DRZ1x9Km3voJqOVPATUjXQ+FYe3n3MCJW9s63iX+LrTSz ZajvVM1c523fIBuFwR5e+1htILzp2mlCPTDplWOpA2Bk1hLGn9AIfRXCbvr9yxYzkff6EqGjF 3APHGvTEgBTyvp8EsP+4BuRK5nTUQlNFLHmWbDaYsvKa78GW04cNVma/tvpgHudHBfNT1POlA ZgPg5GPKV1erKJFveWMQdcn0d4670CNifrQm7jYZE9iRen1nZwTxo+8Y144T6sZSQtKJ5uxHS 1uFJEfjGfNHeHFgUuFHRpAlUhCvU3oTLRba0ZUFgpm8dw4mNv+BUDDqDHTKT2lXW56h2Mw4jv yPsHtz0h5EJu9peHWKbFdYZBq4h3v8cED4UfIXKBzKy7XJnBark5dzE1cN1h5mA/rPAK3OhwN Ebpy1dQEwpBleLsWv1Pw4YhlBiHr1K9c9xDw99hb+OLXaUj0FoErIqo456H4C0sk3hvg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1484 Lines: 40 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 --- 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