summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-04-21 15:50:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-04-23 09:21:17 +0200
commit4ab9051bd30dec196bb10801fcde746776f5a3a7 (patch)
treed223149a9559d24aa328d853f7c52257810d3a98 /common
parent521ffee5262294a87395c52dc54787b2bb159092 (diff)
downloadbarebox-4ab9051bd30dec196bb10801fcde746776f5a3a7.tar.gz
barebox-4ab9051bd30dec196bb10801fcde746776f5a3a7.tar.xz
don't cast negative error codes to unsigned size_t
The cast prevents us from doing proper error checking. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/uimage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/uimage.c b/common/uimage.c
index 7fbef8688e..243dfb0df5 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -74,7 +74,7 @@ void uimage_print_contents(struct uimage_handle *handle)
}
EXPORT_SYMBOL(uimage_print_contents);
-size_t uimage_get_size(struct uimage_handle *handle, unsigned int image_no)
+ssize_t uimage_get_size(struct uimage_handle *handle, unsigned int image_no)
{
if (image_no >= handle->nb_data_entries)
return -EINVAL;
@@ -373,7 +373,7 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)
struct resource *res;
size_t size = BUFSIZ;
size_t ofs = 0;
- size_t now;
+ ssize_t now;
int fd;
fd = open(filename, O_RDONLY);
@@ -420,7 +420,7 @@ struct resource *uimage_load_to_sdram(struct uimage_handle *handle,
int image_no, unsigned long load_address)
{
int ret;
- size_t size;
+ ssize_t size;
resource_size_t start = (resource_size_t)load_address;
uimage_buf = (void *)load_address;