diff options
author | Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com> | 2018-11-02 09:01:25 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-11-02 09:25:32 -0400 |
commit | 9341c668c8c0993452559f278345b2a490ba3ee9 (patch) | |
tree | 346e6a2e41afa9f4da67971c9a115be6e6e32c34 /drivers/gpu/drm/selftests/test-drm_framebuffer.c | |
parent | 6ff3d9ffdcbbe24e8185b254d92d6db44ad55506 (diff) |
drm/selftests: Fix build warning -Wframe-larger-than
It seems for some random configuration drm_device is bigger than 2048
bytes.
The fix is to make the mock objects static variables.
Bug reported by 0-DAY Kernel test infrastructure here:
https://lists.01.org/pipermail/kbuild-all/2018-November/054431.html
Fixes: 6ff3d9ffdcbb ("drm/selftests: Add tests for drm_internal_framebuffer_create")
Signed-off-by: Alexandru-Cosmin Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181102130103.7753-1-alexandru-cosmin.gheorghe@arm.com
Diffstat (limited to 'drivers/gpu/drm/selftests/test-drm_framebuffer.c')
-rw-r--r-- | drivers/gpu/drm/selftests/test-drm_framebuffer.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/selftests/test-drm_framebuffer.c b/drivers/gpu/drm/selftests/test-drm_framebuffer.c index 3098435678af..a04d02dacce2 100644 --- a/drivers/gpu/drm/selftests/test-drm_framebuffer.c +++ b/drivers/gpu/drm/selftests/test-drm_framebuffer.c | |||
@@ -307,25 +307,27 @@ static struct drm_framebuffer *fb_create_mock(struct drm_device *dev, | |||
307 | return ERR_PTR(-EINVAL); | 307 | return ERR_PTR(-EINVAL); |
308 | } | 308 | } |
309 | 309 | ||
310 | static struct drm_mode_config_funcs mock_config_funcs = { | ||
311 | .fb_create = fb_create_mock, | ||
312 | }; | ||
313 | |||
314 | static struct drm_device mock_drm_device = { | ||
315 | .mode_config = { | ||
316 | .min_width = MIN_WIDTH, | ||
317 | .max_width = MAX_WIDTH, | ||
318 | .min_height = MIN_HEIGHT, | ||
319 | .max_height = MAX_HEIGHT, | ||
320 | .allow_fb_modifiers = true, | ||
321 | .funcs = &mock_config_funcs, | ||
322 | }, | ||
323 | }; | ||
324 | |||
310 | static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r) | 325 | static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r) |
311 | { | 326 | { |
312 | int buffer_created = 0; | 327 | int buffer_created = 0; |
313 | struct drm_framebuffer *fb; | 328 | struct drm_framebuffer *fb; |
314 | struct drm_mode_config_funcs mock_config_funcs = { | ||
315 | .fb_create = fb_create_mock, | ||
316 | }; | ||
317 | struct drm_device mock_drm_device = { | ||
318 | .mode_config = { | ||
319 | .min_width = MIN_WIDTH, | ||
320 | .max_width = MAX_WIDTH, | ||
321 | .min_height = MIN_HEIGHT, | ||
322 | .max_height = MAX_HEIGHT, | ||
323 | .allow_fb_modifiers = true, | ||
324 | .funcs = &mock_config_funcs, | ||
325 | }, | ||
326 | .dev_private = &buffer_created | ||
327 | }; | ||
328 | 329 | ||
330 | mock_drm_device.dev_private = &buffer_created; | ||
329 | fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL); | 331 | fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL); |
330 | return buffer_created; | 332 | return buffer_created; |
331 | } | 333 | } |