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

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