1. 15 Dec, 2017 2 commits
    • Arnd Bergmann's avatar
      media: dvb-frontends: fix i2c access helpers for KASAN · 3cd890db
      Arnd Bergmann authored
      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
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      3cd890db
    • Arnd Bergmann's avatar
      media: r820t: fix r820t_write_reg for KASAN · 16c3ada8
      Arnd Bergmann authored
      With CONFIG_KASAN, we get an overly long stack frame due to inlining
      the register access functions:
      
      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=]
      
      This is caused by a gcc bug that has now been fixed in gcc-8.
      To work around the problem, we can pass the register data
      through a local variable that older gcc versions can optimize
      out as well.
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      16c3ada8
  2. 14 Dec, 2017 38 commits