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: 6ff3d9ffdc
("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
This commit is contained in:
parent
6ff3d9ffdc
commit
9341c668c8
|
@ -307,14 +307,11 @@ static struct drm_framebuffer *fb_create_mock(struct drm_device *dev,
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
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 = {
|
||||
static struct drm_mode_config_funcs mock_config_funcs = {
|
||||
.fb_create = fb_create_mock,
|
||||
};
|
||||
struct drm_device mock_drm_device = {
|
||||
};
|
||||
|
||||
static struct drm_device mock_drm_device = {
|
||||
.mode_config = {
|
||||
.min_width = MIN_WIDTH,
|
||||
.max_width = MAX_WIDTH,
|
||||
|
@ -323,9 +320,14 @@ static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r)
|
|||
.allow_fb_modifiers = true,
|
||||
.funcs = &mock_config_funcs,
|
||||
},
|
||||
.dev_private = &buffer_created
|
||||
};
|
||||
};
|
||||
|
||||
static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r)
|
||||
{
|
||||
int buffer_created = 0;
|
||||
struct drm_framebuffer *fb;
|
||||
|
||||
mock_drm_device.dev_private = &buffer_created;
|
||||
fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL);
|
||||
return buffer_created;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue