aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTroy Kisky <troykiskyboundary@gmail.com>2023-03-13 14:31:29 -0700
committerTom Rini <trini@konsulko.com>2023-05-09 11:38:33 -0400
commita14fa151ff99afa428ca4734344f863c9546f10e (patch)
tree18b62429f6e81fea6d86cfc51ae4e54f9cfc07b5
parent3f40ea9c16682625bd1c8b0ce0121d360ec577b7 (diff)
downloadu-boot-a14fa151ff99afa428ca4734344f863c9546f10e.zip
u-boot-a14fa151ff99afa428ca4734344f863c9546f10e.tar.gz
u-boot-a14fa151ff99afa428ca4734344f863c9546f10e.tar.bz2
lib: sha512: prepare for CONFIG_IS_ENABLED changes
We need to include <linux/kconfig.h> in order to include files that use CONFIG_IS_ENABLED. TO prepare for that don't pet the watchdog when USE_HOSTCC is defined. Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--lib/sha512.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sha512.c b/lib/sha512.c
index fbe8d5f..a504281 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -13,6 +13,9 @@
#ifndef USE_HOSTCC
#include <common.h>
#include <linux/string.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
#else
#include <string.h>
#endif /* USE_HOSTCC */
@@ -292,7 +295,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end;
unsigned char *curr;
int chunk;
@@ -300,7 +303,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
sha384_starts(&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {
@@ -355,7 +358,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end;
unsigned char *curr;
int chunk;
@@ -363,7 +366,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
sha512_starts(&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {