diff options
author | Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com> | 2018-11-02 13:01:25 +0000 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-11-02 14:25:32 +0100 |
commit | 9341c668c8c0993452559f278345b2a490ba3ee9 (patch) | |
tree | 346e6a2e41afa9f4da67971c9a115be6e6e32c34 /drivers | |
parent | 6ff3d9ffdcbbe24e8185b254d92d6db44ad55506 (diff) | |
download | linux-9341c668c8c0993452559f278345b2a490ba3ee9.tar.gz |
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')
-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, return ERR_PTR(-EINVAL); } +static struct drm_mode_config_funcs mock_config_funcs = { + .fb_create = fb_create_mock, +}; + +static struct drm_device mock_drm_device = { + .mode_config = { + .min_width = MIN_WIDTH, + .max_width = MAX_WIDTH, + .min_height = MIN_HEIGHT, + .max_height = MAX_HEIGHT, + .allow_fb_modifiers = true, + .funcs = &mock_config_funcs, + }, +}; + static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r) { int buffer_created = 0; struct drm_framebuffer *fb; - struct drm_mode_config_funcs mock_config_funcs = { - .fb_create = fb_create_mock, - }; - struct drm_device mock_drm_device = { - .mode_config = { - .min_width = MIN_WIDTH, - .max_width = MAX_WIDTH, - .min_height = MIN_HEIGHT, - .max_height = MAX_HEIGHT, - .allow_fb_modifiers = true, - .funcs = &mock_config_funcs, - }, - .dev_private = &buffer_created - }; + mock_drm_device.dev_private = &buffer_created; fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL); return buffer_created; } |