aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-12-14 13:30:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-12-14 13:30:53 +0000
commit2933f6980b82ed3dcf1289c8f729fb9ac63e52fa (patch)
tree12c2755cc8ce510dcc1cb51670a98cc4134785e6 /hw/core
parentda885fe1ee8b4589047484bd7fa05a4905b52b17 (diff)
hw/core/loader.c: Remove load_image()
The load_image() function is now no longer used anywhere, so we can remove it completely. (Use load_image_size() or g_file_get_contents() instead.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20181130151712.2312-10-peter.maydell@linaro.org
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/loader.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 66a616608a..fa41842280 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -74,31 +74,6 @@ int64_t get_image_size(const char *filename)
}
/* return the size or -1 if error */
-/* deprecated, because caller does not specify buffer size! */
-int load_image(const char *filename, uint8_t *addr)
-{
- int fd, size;
- fd = open(filename, O_RDONLY | O_BINARY);
- if (fd < 0)
- return -1;
- size = lseek(fd, 0, SEEK_END);
- if (size == -1) {
- fprintf(stderr, "file %-20s: get size error: %s\n",
- filename, strerror(errno));
- close(fd);
- return -1;
- }
-
- lseek(fd, 0, SEEK_SET);
- if (read(fd, addr, size) != size) {
- close(fd);
- return -1;
- }
- close(fd);
- return size;
-}
-
-/* return the size or -1 if error */
ssize_t load_image_size(const char *filename, void *addr, size_t size)
{
int fd;