[U-Boot] [PATCH v2] tools/kwbimage: Fix compilation warning

Anatolij Gustschin agust at denx.de
Thu Oct 30 23:16:22 CET 2014


On Tue, 28 Oct 2014 11:32:24 +0100
Stefan Roese <sr at denx.de> wrote:

> This patch fixes a compilation warning of kwbimage.c:
> 
> tools/kwbimage.c: In function ‘kwbimage_set_header’:
> tools/kwbimage.c:784:8: warning: ‘headersz’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   memcpy(ptr, image, headersz);
>         ^
> Instead of using multiple if statements, use a switch statement with
> a default entry. And return with error if an unsupported version
> is configured in the cfg file.
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> ---
> v2:
> - Change error message so that it really makes sense (unsupported
>   version instead of no version)
> - Change this also in the commit text
> - Small change (s/is/if)
> 
>  tools/kwbimage.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)

Applied to u-boot-staging. Thanks!

Anatolij


More information about the U-Boot mailing list