media: staging: atomisp: reduce kernel stack usage
The atomisp_set_fmt() function has multiple copies of the large v4l2_format structure on its stack, resulting in a warning about excessive stack usage in some rare randconfig builds. drivers/staging/media/atomisp/pci/atomisp_cmd.c:5600:5: error: stack frame size of 1084 bytes in function 'atomisp_set_fmt' [-Werror,-Wframe-larger-than=] Of this structure, only three members in the 'fmt.pix' member are used, so simplify it by using the smaller v4l2_pix_format structure directly. This reduces the stack usage to 612 bytes, and it could be reduced further by only storing the three members that are used. Link: https://lore.kernel.org/linux-media/20210226140524.3478346-1-arnd@kernel.orgSigned-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Showing
Please register or sign in to comment