diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-13 13:11:09 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-13 17:39:49 +0200 |
commit | a64c756ad96e1ce08ff41b7ce305631bb09929c2 (patch) | |
tree | 77bad0bb56879c6ebc5335a3fc140f41acfb145e /common | |
parent | b531c53e74ed686947bd45eab22fb4d3b793a33b (diff) | |
download | barebox-a64c756ad96e1ce08ff41b7ce305631bb09929c2.tar.gz barebox-a64c756ad96e1ce08ff41b7ce305631bb09929c2.tar.xz |
image: remove confusing image_check_* functions
The function names do not make it clear what return value
is expected and do not save a single line of code. Put
the code inline and unbreak the wrong checks introduced
with a3c1e5d888d0ee317ffc7635694684bb71213c9c.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Eric BĂ©nard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/image.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/image.c b/common/image.c index 104446a785..a4c8b95210 100644 --- a/common/image.c +++ b/common/image.c @@ -266,6 +266,7 @@ void image_print_contents(const void *ptr) { const image_header_t *hdr = (const image_header_t *)ptr; const char *p; + int type; #ifdef __BAREBOX__ p = " "; @@ -285,8 +286,8 @@ void image_print_contents(const void *ptr) printf ("%sLoad Address: %08x\n", p, image_get_load(hdr)); printf ("%sEntry Point: %08x\n", p, image_get_ep(hdr)); - if (image_check_type(hdr, IH_TYPE_MULTI) || - image_check_type(hdr, IH_TYPE_SCRIPT)) { + type = image_get_type(hdr); + if (type == IH_TYPE_MULTI || type == IH_TYPE_SCRIPT) { int i; ulong data, len; ulong count = image_multi_count(hdr); @@ -298,7 +299,7 @@ void image_print_contents(const void *ptr) printf("%s Image %d: ", p, i); image_print_size(len); - if (image_check_type(hdr, IH_TYPE_SCRIPT) && i > 0) { + if (image_get_type(hdr) != IH_TYPE_SCRIPT && i > 0) { /* * the user may need to know offsets * if planning to do something with |