X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_source.c;h=6881bc9ddd3382c02c4c6130f313e5efca0066f3;hb=e5a504eb3d8cbc33199dac61a07d16ddd3c1c7f9;hp=f0d7f52bcec0643f5e7ce89fe23b9dba6df96605;hpb=ec7023db8dc95966919589541f1ca09355a3f7a5;p=u-boot diff --git a/common/cmd_source.c b/common/cmd_source.c index f0d7f52bce..6881bc9ddd 100644 --- a/common/cmd_source.c +++ b/common/cmd_source.c @@ -2,23 +2,7 @@ * (C) Copyright 2001 * Kyle Harris, kharris@nexus-tech.net * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -45,7 +29,9 @@ int source (ulong addr, const char *fit_uname) { ulong len; +#if defined(CONFIG_IMAGE_FORMAT_LEGACY) const image_header_t *hdr; +#endif ulong *data; int verify; void *buf; @@ -60,6 +46,7 @@ source (ulong addr, const char *fit_uname) buf = map_sysmem(addr, 0); switch (genimg_get_format(buf)) { +#if defined(CONFIG_IMAGE_FORMAT_LEGACY) case IMAGE_FORMAT_LEGACY: hdr = buf; @@ -100,6 +87,7 @@ source (ulong addr, const char *fit_uname) */ while (*data++); break; +#endif #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: if (fit_uname == NULL) { @@ -127,7 +115,7 @@ source (ulong addr, const char *fit_uname) /* verify integrity */ if (verify) { - if (!fit_image_check_hashes (fit_hdr, noffset)) { + if (!fit_image_verify(fit_hdr, noffset)) { puts ("Bad Data Hash\n"); return 1; } @@ -154,8 +142,7 @@ source (ulong addr, const char *fit_uname) /**************************************************/ #if defined(CONFIG_CMD_SOURCE) -int -do_source (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr; int rcode;