]> git.baikalelectronics.ru Git - kernel.git/commit
media: staging: media: davinci_vpfe: fix large stack usage with clang
authorArnd Bergmann <arnd@arndb.de>
Wed, 13 Mar 2019 21:10:29 +0000 (17:10 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 29 Mar 2019 11:37:10 +0000 (07:37 -0400)
commitc2cc3ba0732038912d4fe0b8e8d1e393a02778f7
treecc5204c047d605f2be66aac39dfab914a5572eb6
parent8f5967c9c65656fbc9e245e8582fbf7583f7bfd1
media: staging: media: davinci_vpfe: fix large stack usage with clang

clang is unable to optimize the isif_ioctl() in the same way that
gcc does, as it fails to prove that the local copy of
the 'struct vpfe_isif_raw_config' argument is unnecessary:

drivers/staging/media/davinci_vpfe/dm365_isif.c:622:13: error: stack frame size of 1344 bytes in function 'isif_ioctl' [-Werror,-Wframe-larger-than=]

Marking it as 'const' while passing the data down clearly shows us that
the copy is never modified, and we can skip copying it entirely, which
reduces the stack usage to just eight bytes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/davinci_vpfe/dm365_isif.c