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

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