X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fimage.c;h=f63a2ff1a05b4d5aa3d38df62b3553ad31d6b21f;hb=6052cbab40e927f94bcb034f1b4c76a18d6729e1;hp=89c10b8596ed969f95de976d70d1f6189d97e339;hpb=d9d47d18e8cee8ae290218ce5d9669b9563073e3;p=u-boot diff --git a/common/image.c b/common/image.c index 89c10b8596..f63a2ff1a0 100644 --- a/common/image.c +++ b/common/image.c @@ -74,7 +74,7 @@ static const image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch, #include #endif /* !USE_HOSTCC*/ -static table_entry_t uimage_arch[] = { +static const table_entry_t uimage_arch[] = { { IH_ARCH_INVALID, NULL, "Invalid ARCH", }, { IH_ARCH_ALPHA, "alpha", "Alpha", }, { IH_ARCH_ARM, "arm", "ARM", }, @@ -96,7 +96,7 @@ static table_entry_t uimage_arch[] = { { -1, "", "", }, }; -static table_entry_t uimage_os[] = { +static const table_entry_t uimage_os[] = { { IH_OS_INVALID, NULL, "Invalid OS", }, { IH_OS_LINUX, "linux", "Linux", }, #if defined(CONFIG_LYNXKDI) || defined(USE_HOSTCC) @@ -129,7 +129,7 @@ static table_entry_t uimage_os[] = { { -1, "", "", }, }; -static table_entry_t uimage_type[] = { +static const table_entry_t uimage_type[] = { { IH_TYPE_INVALID, NULL, "Invalid Image", }, { IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image", }, { IH_TYPE_FIRMWARE, "firmware", "Firmware", }, @@ -144,7 +144,7 @@ static table_entry_t uimage_type[] = { { -1, "", "", }, }; -static table_entry_t uimage_comp[] = { +static const table_entry_t uimage_comp[] = { { IH_COMP_NONE, "none", "uncompressed", }, { IH_COMP_BZIP2, "bzip2", "bzip2 compressed", }, { IH_COMP_GZIP, "gzip", "gzip compressed", }, @@ -516,11 +516,11 @@ static void genimg_print_time (time_t timestamp) * long entry name if translation succeeds * msg otherwise */ -char *get_table_entry_name (table_entry_t *table, char *msg, int id) +char *get_table_entry_name(const table_entry_t *table, char *msg, int id) { for (; table->id >= 0; ++table) { if (table->id == id) -#if defined(USE_HOSTCC) || defined(CONFIG_RELOC_FIXUP_WORKS) +#if defined(USE_HOSTCC) || !defined(CONFIG_NEEDS_MANUAL_RELOC) return table->lname; #else return table->lname + gd->reloc_off; @@ -563,10 +563,10 @@ const char *genimg_get_comp_name (uint8_t comp) * entry id if translation succeeds * -1 otherwise */ -int get_table_entry_id (table_entry_t *table, +int get_table_entry_id(const table_entry_t *table, const char *table_name, const char *name) { - table_entry_t *t; + const table_entry_t *t; #ifdef USE_HOSTCC int first = 1; @@ -585,10 +585,10 @@ int get_table_entry_id (table_entry_t *table, fprintf (stderr, "\n"); #else for (t = table; t->id >= 0; ++t) { -#ifdef CONFIG_RELOC_FIXUP_WORKS - if (t->sname && strcmp(t->sname, name) == 0) -#else +#ifdef CONFIG_NEEDS_MANUAL_RELOC if (t->sname && strcmp(t->sname + gd->reloc_off, name) == 0) +#else + if (t->sname && strcmp(t->sname, name) == 0) #endif return (t->id); }