From: Lukasz Majewski Date: Tue, 10 Jun 2014 10:25:59 +0000 (+0200) Subject: dfu: Disable default calculation of CRC32 X-Git-Tag: v2014.07-rc4~111^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3d83e6752d5595351a47309aab0749984c5909b7;p=u-boot dfu: Disable default calculation of CRC32 Patch (SHA1: bd694244db7bc969954) dfu: Introduction of the "dfu_hash_algo" env variable for checksum method setting already introduced more generic handling of the crc32 calculation. Up till now the CRC32 of received data was calculated unconditionally. This patch changes this and from now - by default the crc32 is NOT calculated anymore. Signed-off-by: Lukasz Majewski Cc: Marek Vasut --- diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 5878f991d9..dc09ff6466 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -106,21 +106,15 @@ static char *dfu_get_hash_algo(void) char *s; s = getenv("dfu_hash_algo"); - /* - * By default the legacy behaviour to calculate the crc32 hash - * value is preserved. - * - * To disable calculation of the hash algorithm for received data - * specify the "dfu_hash_algo = disabled" at your board envs. - */ - debug("%s: DFU hash method: %s\n", __func__, s ? s : "not specified"); - - if (!s || !strcmp(s, "crc32")) - return "crc32"; - - if (!strcmp(s, "disabled")) + if (!s) return NULL; + if (!strcmp(s, "crc32")) { + debug("%s: DFU hash method: %s\n", __func__, s); + return s; + } + + error("DFU hash method: %s not supported!\n", s); return NULL; }