public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dfu: Disable default calculation of CRC32
@ 2014-06-10 10:25 Lukasz Majewski
  2014-06-11  0:32 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Majewski @ 2014-06-10 10:25 UTC (permalink / raw)
  To: u-boot

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 <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
---
 drivers/dfu/dfu.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 5878f99..dc09ff6 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;
 }
 
-- 
2.0.0.rc2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] dfu: Disable default calculation of CRC32
  2014-06-10 10:25 [U-Boot] [PATCH] dfu: Disable default calculation of CRC32 Lukasz Majewski
@ 2014-06-11  0:32 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2014-06-11  0:32 UTC (permalink / raw)
  To: u-boot

On Tuesday, June 10, 2014 at 12:25:59 PM, Lukasz Majewski wrote:
> 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 <l.majewski@samsung.com>
> Cc: Marek Vasut <marex@denx.de>

Applied, thanks.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-11  0:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 10:25 [U-Boot] [PATCH] dfu: Disable default calculation of CRC32 Lukasz Majewski
2014-06-11  0:32 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox