Fix inconsistency of VERIFY defines in cmd_mem
PATCH 1/2 Fix inconsistency of VERIFY defines in cmd_mem
Introduced in change d20a40de9db07de1f1f06a79a4da1cdda5379b75 "Roll crc32 into hash infrastructure"
Use a consistent define to enable the verify feature in crc32 command.
---
common/cmd_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
common/cmd_mem.c +3 -3
@@ -1303,7 +1303,7 @@ U_BOOT_CMD(#ifdef CONFIG_CMD_CRC32 -#ifndef CONFIG_CRC32_VERIFY +#ifndef CONFIG_HASH_VERIFY U_BOOT_CMD( crc32, 4, 1, do_mem_crc,
@@ -1311,7 +1311,7 @@ U_BOOT_CMD("address count [addr]\n - compute CRC32 checksum [save at addr]" ); -#else /* CONFIG_CRC32_VERIFY */ +#else /* CONFIG_HASH_VERIFY */ U_BOOT_CMD( crc32, 5, 1, do_mem_crc,
@@ -1320,7 +1320,7 @@ U_BOOT_CMD("-v address count crc\n - verify crc of memory area" ); -#endif /* CONFIG_CRC32_VERIFY */ +#endif /* CONFIG_HASH_VERIFY */ #endif
Signature · 1 line
1.7.11.5
PATCH 2/2 Fix broken verify functionality in crc32 command
Introduced in change d20a40de9db07de1f1f06a79a4da1cdda5379b75 "Roll crc32 into hash infrastructure"
The crc32 command with no -v expects an optional 3rd argument to be an address to store the result in. With the -v switch, the last argument is a crc, not an address. In the case where -v is set, we should set the HASH_FLAG_ENV flag since that will first look for the value to be a digest value, which matches the expected API for the crc32 command.
---
common/cmd_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/cmd_mem.c +1 -1
@@ -1227,7 +1227,7 @@ static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ac = argc -1 ;#ifdef CONFIG_HASH_VERIFY if (strcmp (*av,"-v" ) ==0 ) { - flags |=HASH_FLAG_VERIFY ; + flags |=HASH_FLAG_VERIFY |HASH_FLAG_ENV ; av++; ac--; }
Signature · 1 line
1.7.11.5
PATCH 2/2 Fix broken verify functionality in crc32 command
Quoted 9 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"The crc32 command with no -v expects an optional 3rd argument to be an address to store the result in. With the -v switch, the last argument is a crc, not an address. In the case where -v is set, we should set the
HASH_FLAG_ENVflag since that will first look for the value to be a digest value, which matches the expected API for the crc32 command.
Quoted 5 lines
Signed-off-by Joe Hershberger <[email protected]>---
common/cmd_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 2/2 Fix broken verify functionality in crc32 command
In reply to Joe HershbergerQuoted 11 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"The crc32 command with no -v expects an optional 3rd argument to be an address to store the result in. With the -v switch, the last argument is a crc, not an address. In the case where -v is set, we should set the
HASH_FLAG_ENVflag since that will first look for the value to be a digest value, which matches the expected API for the crc32 command.Signed-off-by Joe Hershberger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150510/9e5546c0/attachment.sig>
PATCH 1/2 Fix inconsistency of VERIFY defines in cmd_mem
In reply to Joe HershbergerHi Joe,
Quoted 17 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"Use a consistent define to enable the verify feature in crc32 command.
Signed-off-by Joe Hershberger <[email protected]>---
common/cmd_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)common/cmd_mem.c +0
-0
common/cmd_mem.c U_BOOT_CMD( · line 1306
Quoted 5 lines
common/cmd_mem.c +1
-1@@ -1303,7 +1303,7 @@ U_BOOT_CMD(#ifdef CONFIG_CMD_CRC32 -#ifndef CONFIG_CRC32_VERIFY +#ifndef CONFIG_HASH_VERIFY
Do you need to change the users of CONFIG_CRC32_VERIFY?
Quoted 22 lines
common/cmd_mem.c +2
-3U_BOOT_CMD( crc32, 4, 1, do_mem_crc,@@ -1311,7 +1311,7 @@ U_BOOT_CMD("address count [addr]\n - compute CRC32 checksum [save at addr]" ); -#else /* CONFIG_CRC32_VERIFY */ +#else /* CONFIG_HASH_VERIFY */ U_BOOT_CMD( crc32, 5, 1, do_mem_crc,@@ -1320,7 +1320,7 @@ U_BOOT_CMD("-v address count crc\n - verify crc of memory area" ); -#endif /* CONFIG_CRC32_VERIFY */ +#endif /* CONFIG_HASH_VERIFY */ #endif --
Quoted 2 lines
1.7.11.5
Regards,
Simon
PATCH 1/2 Fix inconsistency of VERIFY defines in cmd_mem
Hi Simon,
Quoted 21 lines · Simon Glass
Hi Joe,
Quoted 18 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"Use a consistent define to enable the verify feature in crc32 command.
Signed-off-by Joe Hershberger <[email protected]>---
common/cmd_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)common/cmd_mem.c +0
-0@@ -1303,7 +1303,7 @@ U_BOOT_CMD(
Quoted 6 lines
common/cmd_mem.c U_BOOT_CMD( · line 1306
Quoted 4 lines
common/cmd_mem.c +1
-1#ifdef CONFIG_CMD_CRC32 -#ifndef CONFIG_CRC32_VERIFY +#ifndef CONFIG_HASH_VERIFY Do you need to change the users of
CONFIG_CRC32_VERIFY?
Shouldn't need to just like you didn't on the other similar change to this file because in include/hash.h:
#if defined(CONFIG_SHA1SUM_VERIFY) || defined(CONFIG_CRC32_VERIFY) #define CONFIG_HASH_VERIFY
#endif
Quoted 16 lines
Quoted 16 lines
common/cmd_mem.c +1
-1U_BOOT_CMD( crc32, 4, 1, do_mem_crc,@@ -1311,7 +1311,7 @@ U_BOOT_CMD("address count [addr]\n - compute CRC32 checksum [save at addr]" ); -#else /* CONFIG_CRC32_VERIFY */ +#else /* CONFIG_HASH_VERIFY */ U_BOOT_CMD( crc32, 5, 1, do_mem_crc,@@ -1320,7 +1320,7 @@ U_BOOT_CMD("-v address count crc\n - verify crc of memory area" );
Quoted 7 lines
Quoted 7 lines
common/cmd_mem.c +1
-2-#endif /* CONFIG_CRC32_VERIFY */ +#endif /* CONFIG_HASH_VERIFY */ #endif --1.7.11.5
Cheers,
-Joe
PATCH 1/2 Fix inconsistency of VERIFY defines in cmd_mem
Hi Joe,
Quoted 31 lines · Joe Hershberger
Hi Simon,
Quoted 21 lines · Simon Glass
Hi Joe,
Quoted 18 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"Use a consistent define to enable the verify feature in crc32 command.
Signed-off-by Joe Hershberger <[email protected]>---
common/cmd_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)common/cmd_mem.c +0
-0@@ -1303,7 +1303,7 @@ U_BOOT_CMD(Quoted 6 lines
common/cmd_mem.c U_BOOT_CMD( · line 1306
Quoted 4 lines
common/cmd_mem.c +1
-1#ifdef CONFIG_CMD_CRC32 -#ifndef CONFIG_CRC32_VERIFY +#ifndef CONFIG_HASH_VERIFY Do you need to change the users of
CONFIG_CRC32_VERIFY?
Quoted 6 lines
Shouldn't need to just like you didn't on the other similar change to this file because in
include/hash.h:#if
defined(CONFIG_SHA1SUM_VERIFY)||defined(CONFIG_CRC32_VERIFY)#defineCONFIG_HASH_VERIFY
#endif
OK, thanks.
Regards,
Simon
PATCH 1/2 Fix inconsistency of VERIFY defines in cmd_mem
In reply to Joe HershbergerQuoted 7 lines · Joe Hershberger
Introduced in change
d20a40de9db07de1f1f06a79a4da1cdda5379b75"Roll crc32 into hash infrastructure"Use a consistent define to enable the verify feature in crc32 command.
Signed-off-by Joe Hershberger <[email protected]>Acked-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150510/626d269d/attachment.sig>