[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 1/9] bufio: Use grub_size_t instead of plain int for size
From: |
Daniel Kiper |
Subject: |
[PATCH v4 1/9] bufio: Use grub_size_t instead of plain int for size |
Date: |
Tue, 30 Oct 2018 14:12:50 +0100 |
Signed-off-by: Vladimir Serbinenko <address@hidden>
Signed-off-by: Daniel Kiper <address@hidden>
---
grub-core/io/bufio.c | 6 +++---
include/grub/bufio.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c
index dbed647..d2f4fb4 100644
--- a/grub-core/io/bufio.c
+++ b/grub-core/io/bufio.c
@@ -43,7 +43,7 @@ typedef struct grub_bufio *grub_bufio_t;
static struct grub_fs grub_bufio_fs;
grub_file_t
-grub_bufio_open (grub_file_t io, int size)
+grub_bufio_open (grub_file_t io, grub_size_t size)
{
grub_file_t file;
grub_bufio_t bufio = 0;
@@ -57,7 +57,7 @@ grub_bufio_open (grub_file_t io, int size)
else if (size > GRUB_BUFIO_MAX_SIZE)
size = GRUB_BUFIO_MAX_SIZE;
- if ((size < 0) || ((unsigned) size > io->size))
+ if (size > io->size)
size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE :
io->size);
@@ -88,7 +88,7 @@ grub_bufio_open (grub_file_t io, int size)
}
grub_file_t
-grub_buffile_open (const char *name, int size)
+grub_buffile_open (const char *name, grub_size_t size)
{
grub_file_t io, file;
diff --git a/include/grub/bufio.h b/include/grub/bufio.h
index acdd0c8..77eb8ee 100644
--- a/include/grub/bufio.h
+++ b/include/grub/bufio.h
@@ -22,7 +22,7 @@
#include <grub/file.h>
-grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size);
-grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size);
+grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, grub_size_t size);
+grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, grub_size_t
size);
#endif /* ! GRUB_BUFIO_H */
--
1.7.10.4
- [PATCH v4 0/9] verifiers: Framework and EFI shim lock verifier, Daniel Kiper, 2018/10/30
- [PATCH v4 3/9] verifiers: Framework core, Daniel Kiper, 2018/10/30
- [PATCH v4 6/9] verifiers: Rename verify module to pgp module, Daniel Kiper, 2018/10/30
- [PATCH v4 4/9] verifiers: Add possibility to verify kernel and modules command lines, Daniel Kiper, 2018/10/30
- [PATCH v4 8/9] dl: Add support for persistent modules, Daniel Kiper, 2018/10/30
- [PATCH v4 7/9] verifiers: Add the documentation, Daniel Kiper, 2018/10/30
- [PATCH v4 5/9] verifiers: Add possibility to defer verification to other verifiers, Daniel Kiper, 2018/10/30
- [PATCH v4 1/9] bufio: Use grub_size_t instead of plain int for size,
Daniel Kiper <=
- [PATCH v4 2/9] verifiers: File type for fine-grained signature-verification controlling, Daniel Kiper, 2018/10/30
- [PATCH v4 9/9] efi: Add EFI shim lock verifier, Daniel Kiper, 2018/10/30
- Re: [PATCH v4 0/9] verifiers: Framework and EFI shim lock verifier, Ross Philipson, 2018/10/31