diff options
author | smh <smh@FreeBSD.org> | 2016-01-28 12:11:42 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-28 12:11:42 +0000 |
commit | 634e73dbb861268bd122cc29b02b1a56df450dd6 (patch) | |
tree | 7fd1c618154ccfb649dc2a3ef4b6030c01df8f81 /sys/boot/common/misc.c | |
parent | fe8f0aa165649acdaf27427ebefed487585a9d35 (diff) | |
download | FreeBSD-src-634e73dbb861268bd122cc29b02b1a56df450dd6.zip FreeBSD-src-634e73dbb861268bd122cc29b02b1a56df450dd6.tar.gz |
MFC r281169, r293724, r293796, r294029, r294041, r294058
MFC r281169 (by andrew):
Make global variabled only used in this file static
MFC r294058:
Make common boot file_loadraw name parameter const
MFC r294041:
Remove unused reg param from fdt_fixup_memory
MFC r293724:
Enable warnings in EFI boot code
MFC r293796:
Fix typo in libefi.c
MFC r294029:
Only build EFI components on supported compilers
Sponsored by: Multiplay
Diffstat (limited to 'sys/boot/common/misc.c')
-rw-r--r-- | sys/boot/common/misc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/boot/common/misc.c b/sys/boot/common/misc.c index c4c36ea..228dfaf 100644 --- a/sys/boot/common/misc.c +++ b/sys/boot/common/misc.c @@ -118,14 +118,12 @@ kern_bzero(vm_offset_t dest, size_t len) int kern_pread(int fd, vm_offset_t dest, size_t len, off_t off) { - ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { printf("\nlseek failed\n"); return (-1); } - nread = archsw.arch_readin(fd, dest, len); - if (nread != len) { + if ((size_t)archsw.arch_readin(fd, dest, len) != len) { printf("\nreadin failed\n"); return (-1); } @@ -140,7 +138,6 @@ void * alloc_pread(int fd, off_t off, size_t len) { void *buf; - ssize_t nread; buf = malloc(len); if (buf == NULL) { @@ -152,8 +149,7 @@ alloc_pread(int fd, off_t off, size_t len) free(buf); return (NULL); } - nread = read(fd, buf, len); - if (nread != len) { + if ((size_t)read(fd, buf, len) != len) { printf("\nread failed\n"); free(buf); return (NULL); |