[PATCH 14/14] don't cast negative error codes to unsigned size_t

Juergen Beisert jbe at pengutronix.de
Fri Feb 7 04:17:28 EST 2014


On Friday 07 February 2014 09:48:56 Lucas Stach wrote:
> The cast prevents us from doing proper error checking.
>
> Signed-off-by: Lucas Stach <dev at lynxeye.de>
> ---
>  common/uimage.c | 6 +++---
>  include/image.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/common/uimage.c b/common/uimage.c
> index 7fbef86..4296359 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)
> +int uimage_get_size(struct uimage_handle *handle, unsigned int image_no)

What about "ssize_t"?

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |



More information about the barebox mailing list