From ad6e1dbe7cd38539df2ed73f02292fcfa8bc157b Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 8 Feb 2019 14:18:52 +0100 Subject: igt: fb: Refactor dumb buffer allocation path The else condition is not needed, since all the other conditions return when they are done. Move the KMS dumb buffer allocation outside of the outer else condition, this will also allow to ease later changes. Reviewed-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Reviewed-by: Deepak Rawat Reviewed-by: Lyude Paul --- lib/igt_fb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 5d8c187a9..c61e6805f 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -559,15 +559,14 @@ static int create_bo_for_fb(struct igt_fb *fb) igt_require(driver_has_gem_api); return -EINVAL; } - } else { - fb->is_dumb = true; + } - fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height, - fb->plane_bpp[0], - &fb->strides[0], &fb->size); + fb->is_dumb = true; + fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height, + fb->plane_bpp[0], + &fb->strides[0], &fb->size); - return fb->gem_handle; - } + return fb->gem_handle; } /** -- cgit v1.2.3