[U-Boot] [PATCH v2 42/45] image: Remove remaining #ifdefs in image-fit.c
Simon Glass
sjg at chromium.org
Tue Mar 19 00:52:02 CET 2013
There are only two left. One is unnecessary and the other can be moved
to the header file.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v2:
- Add new patch to remove #ifdefs in image-fit.c
common/image-fit.c | 9 ++-------
common/image.c | 7 +------
include/image.h | 2 ++
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
index 30790d3..29ea4c9 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -151,11 +151,8 @@ void fit_print_contents(const void *fit)
const char *p;
time_t timestamp;
-#ifdef USE_HOSTCC
- p = "";
-#else
- p = " ";
-#endif
+ /* Indent string is defined in header image.h */
+ p = IMAGE_INDENT_STRING;
/* Root node properties */
ret = fit_get_desc(fit, 0, &desc);
@@ -1504,7 +1501,6 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
* 1, on success
* 0, on failure
*/
-#ifndef USE_HOSTCC
int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
int verify)
{
@@ -1533,4 +1529,3 @@ int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
bootstage_mark(BOOTSTAGE_ID_FIT_RD_CHECK_ALL_OK);
return 1;
}
-#endif /* USE_HOSTCC */
diff --git a/common/image.c b/common/image.c
index 14d1c48..f013fdc 100644
--- a/common/image.c
+++ b/common/image.c
@@ -295,12 +295,7 @@ void image_print_contents(const void *ptr)
const image_header_t *hdr = (const image_header_t *)ptr;
const char *p;
-#ifdef USE_HOSTCC
- p = "";
-#else
- p = " ";
-#endif
-
+ p = IMAGE_INDENT_STRING;
printf("%sImage Name: %.*s\n", p, IH_NMLEN, image_get_name(hdr));
if (IMAGE_ENABLE_TIMESTAMP) {
printf("%sCreated: ", p);
diff --git a/include/image.h b/include/image.h
index cbbc17e..5766b58 100644
--- a/include/image.h
+++ b/include/image.h
@@ -47,6 +47,7 @@
#define CONFIG_FIT_SIGNATURE
#define IMAGE_ENABLE_IGNORE 0
+#define IMAGE_INDENT_STRING ""
#else
@@ -56,6 +57,7 @@
/* Take notice of the 'ignore' property for hashes */
#define IMAGE_ENABLE_IGNORE 1
+#define IMAGE_INDENT_STRING " "
#endif /* USE_HOSTCC */
--
1.8.1.3
More information about the U-Boot
mailing list