From e7226ccb1b0d5cac7da37cf3cb85d61ed050595b Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 4 Jan 2021 15:50:37 +0000 Subject: [PATCH] gpu: nvgpu: Fix stack frame size warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building NVGPU for Linux kernels where the CONFIG_FRAME_WARN is set to 1024, the following build error is observed ... drivers/gpu/nvgpu/common/init/nvgpu_init.c: In function ‘nvgpu_finalize_poweron’: drivers/gpu/nvgpu/common/init/nvgpu_init.c:773:1: error: the frame size of 1280 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] The problem is that nvgpu_finalize_poweron() function defines a large table of function pointers, nvgpu_init_table, and cannot be declared statically. To allow NVGPU to be compiled for Linux kernels that by default warn if the stack frame size exceeds 1024, always set the -Wframe-larger-than to 2048 for NVGPU. Bug 200689205 Change-Id: I59b202801a9e5fecda1a9a166cddf54775131dbe Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2465820 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index c8a848e43..81f67fdeb 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -7,6 +7,7 @@ ccflags-y += -I$(srctree.nvgpu)/include/uapi ccflags-y += -I$(srctree)/drivers/devfreq +ccflags-y += -Wframe-larger-than=2048 ccflags-y += -Wno-multichar ccflags-y += -Werror ccflags-y += -Wno-error=cpp