From a64c756ad96e1ce08ff41b7ce305631bb09929c2 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Oct 2010 13:11:09 +0200 Subject: image: remove confusing image_check_* functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Eric BĂ©nard Acked-by: Jean-Christophe PLAGNIOL-VILLARD --- common/image.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common/image.c') 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 -- cgit v1.2.3