media: dvb-frontends: fix i2c access helpers for KASAN
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Nov 2017 16:55:46 +0000 (11:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:23:04 +0000 (20:23 +0100)
commitad91b2e392be4339e09eefd8479675b4232ddfa1
treee24c59d9f832049703cd91f4b134946530de37f9
parent062cd3463c176c71d23e6ca92cda76500ad158d3
media: dvb-frontends: fix i2c access helpers for KASAN

commit 3cd890dbe2a4f14cc44c85bb6cf37e5e22d4dd0e upstream.

A typical code fragment was copied across many dvb-frontend drivers and
causes large stack frames when built with with CONFIG_KASAN on gcc-5/6/7:

drivers/media/dvb-frontends/cxd2841er.c:3225:1: error: the frame size of 3992 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/cxd2841er.c:3404:1: error: the frame size of 3136 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv0367.c:3143:1: error: the frame size of 4016 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv090x.c:3430:1: error: the frame size of 5312 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv090x.c:4248:1: error: the frame size of 4872 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]

gcc-8 now solves this by consolidating the stack slots for the argument
variables, but on older compilers we can get the same behavior by taking
the pointer of a local variable rather than the inline function argument.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 files changed:
drivers/media/dvb-frontends/ascot2e.c
drivers/media/dvb-frontends/cxd2841er.c
drivers/media/dvb-frontends/helene.c
drivers/media/dvb-frontends/horus3a.c
drivers/media/dvb-frontends/itd1000.c
drivers/media/dvb-frontends/mt312.c
drivers/media/dvb-frontends/stb0899_drv.c
drivers/media/dvb-frontends/stb6100.c
drivers/media/dvb-frontends/stv0367.c
drivers/media/dvb-frontends/stv090x.c
drivers/media/dvb-frontends/stv6110x.c
drivers/media/dvb-frontends/zl10039.c