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

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