Blame SOURCES/0329-bufio-Use-grub_size_t-instead-of-plain-int-for-size.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Daniel Kiper <daniel.kiper@oracle.com>
80913e
Date: Mon, 29 Oct 2018 13:25:25 +0100
80913e
Subject: [PATCH] bufio: Use grub_size_t instead of plain int for size
80913e
80913e
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
80913e
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
80913e
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
80913e
(cherry picked from commit f3f8347569383e7f483f37ca70d41eb1af9f990f)
80913e
Signed-off-by: Daniel Axtens <dja@axtens.net>
80913e
---
80913e
 grub-core/io/bufio.c | 6 +++---
80913e
 include/grub/bufio.h | 4 ++--
80913e
 2 files changed, 5 insertions(+), 5 deletions(-)
80913e
80913e
diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c
b32e65
index 6118bade5..2781afe05 100644
80913e
--- a/grub-core/io/bufio.c
80913e
+++ b/grub-core/io/bufio.c
80913e
@@ -43,7 +43,7 @@ typedef struct grub_bufio *grub_bufio_t;
80913e
 static struct grub_fs grub_bufio_fs;
80913e
 
80913e
 grub_file_t
80913e
-grub_bufio_open (grub_file_t io, int size)
80913e
+grub_bufio_open (grub_file_t io, grub_size_t size)
80913e
 {
80913e
   grub_file_t file;
80913e
   grub_bufio_t bufio = 0;
80913e
@@ -57,7 +57,7 @@ grub_bufio_open (grub_file_t io, int size)
80913e
   else if (size > GRUB_BUFIO_MAX_SIZE)
80913e
     size = GRUB_BUFIO_MAX_SIZE;
80913e
 
80913e
-  if ((size < 0) || ((unsigned) size > io->size))
80913e
+  if (size > io->size)
80913e
     size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE :
80913e
             io->size);
80913e
 
80913e
@@ -88,7 +88,7 @@ grub_bufio_open (grub_file_t io, int size)
80913e
 }
80913e
 
80913e
 grub_file_t
80913e
-grub_buffile_open (const char *name, int size)
80913e
+grub_buffile_open (const char *name, grub_size_t size)
80913e
 {
80913e
   grub_file_t io, file;
80913e
 
80913e
diff --git a/include/grub/bufio.h b/include/grub/bufio.h
b32e65
index acdd0c882..77eb8ee56 100644
80913e
--- a/include/grub/bufio.h
80913e
+++ b/include/grub/bufio.h
80913e
@@ -22,7 +22,7 @@
80913e
 
80913e
 #include <grub/file.h>
80913e
 
80913e
-grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size);
80913e
-grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size);
80913e
+grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, grub_size_t size);
80913e
+grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, grub_size_t size);
80913e
 
80913e
 #endif /* ! GRUB_BUFIO_H */