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

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