Blame SOURCES/0415-video-efi_gop-Remove-unnecessary-return-value-of-gru.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Darren Kenny <darren.kenny@oracle.com>
80913e
Date: Tue, 8 Dec 2020 21:14:31 +0000
80913e
Subject: [PATCH] video/efi_gop: Remove unnecessary return value of
80913e
 grub_video_gop_fill_mode_info()
80913e
80913e
The return value of grub_video_gop_fill_mode_info() is never able to be
80913e
anything other than GRUB_ERR_NONE. So, rather than continue to return
80913e
a value and checking it each time, it is more correct to redefine the
80913e
function to not return anything and remove checks of its return value
80913e
altogether.
80913e
80913e
Fixes: CID 96701
80913e
80913e
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
80913e
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
80913e
---
80913e
 grub-core/video/efi_gop.c | 25 ++++++-------------------
80913e
 1 file changed, 6 insertions(+), 19 deletions(-)
80913e
80913e
diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
b32e65
index c9e40e8d4..9fcc41ac0 100644
80913e
--- a/grub-core/video/efi_gop.c
80913e
+++ b/grub-core/video/efi_gop.c
80913e
@@ -229,7 +229,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode,
80913e
   return GRUB_ERR_NONE;
80913e
 }
80913e
 
80913e
-static grub_err_t
80913e
+static void
80913e
 grub_video_gop_fill_mode_info (unsigned mode,
80913e
 			       struct grub_efi_gop_mode_info *in,
80913e
 			       struct grub_video_mode_info *out)
80913e
@@ -254,8 +254,6 @@ grub_video_gop_fill_mode_info (unsigned mode,
80913e
   out->blit_format = GRUB_VIDEO_BLIT_FORMAT_BGRA_8888;
80913e
   out->mode_type |= (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
80913e
 		     | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);
80913e
-
80913e
-  return GRUB_ERR_NONE;
80913e
 }
80913e
 
80913e
 static int
80913e
@@ -268,7 +266,6 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo
80913e
       grub_efi_uintn_t size;
80913e
       grub_efi_status_t status;
80913e
       struct grub_efi_gop_mode_info *info = NULL;
80913e
-      grub_err_t err;
80913e
       struct grub_video_mode_info mode_info;
80913e
 	 
80913e
       status = efi_call_4 (gop->query_mode, gop, mode, &size, &info;;
80913e
@@ -279,12 +276,7 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo
80913e
 	  continue;
80913e
 	}
80913e
 
80913e
-      err = grub_video_gop_fill_mode_info (mode, info, &mode_info);
80913e
-      if (err)
80913e
-	{
80913e
-	  grub_errno = GRUB_ERR_NONE;
80913e
-	  continue;
80913e
-	}
80913e
+      grub_video_gop_fill_mode_info (mode, info, &mode_info);
80913e
       if (hook (&mode_info, hook_arg))
80913e
 	return 1;
80913e
     }
80913e
@@ -468,13 +460,8 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
80913e
 
80913e
   info = gop->mode->info;
80913e
 
80913e
-  err = grub_video_gop_fill_mode_info (gop->mode->mode, info,
80913e
-				       &framebuffer.mode_info);
80913e
-  if (err)
80913e
-    {
80913e
-      grub_dprintf ("video", "GOP: couldn't fill mode info\n");
80913e
-      return err;
80913e
-    }
80913e
+  grub_video_gop_fill_mode_info (gop->mode->mode, info,
80913e
+				 &framebuffer.mode_info);
80913e
 
80913e
   framebuffer.ptr = (void *) (grub_addr_t) gop->mode->fb_base;
80913e
   framebuffer.offscreen
80913e
@@ -488,8 +475,8 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
80913e
     {
80913e
       grub_dprintf ("video", "GOP: couldn't allocate shadow\n");
80913e
       grub_errno = 0;
80913e
-      err = grub_video_gop_fill_mode_info (gop->mode->mode, info,
80913e
-					   &framebuffer.mode_info);
80913e
+      grub_video_gop_fill_mode_info (gop->mode->mode, info,
80913e
+				     &framebuffer.mode_info);
80913e
       buffer = framebuffer.ptr;
80913e
     }
80913e