[PATCH v3 05/23] lib: sha1: prepare for CONFIG_IS_ENABLED changes
Troy Kisky
troykiskyboundary at gmail.com
Mon Mar 13 22:31:27 CET 2023
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 at gmail.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
(no changes since v2)
Changes in v2:
- delay include of linux/kconfig.h to do from Makefile
- as suggested by Simon
lib/sha1.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/sha1.c b/lib/sha1.c
index 8d074078934..cd5d7aead8d 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -19,6 +19,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 */
@@ -328,14 +331,14 @@ void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha1_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end, *curr;
int chunk;
#endif
sha1_starts (&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = input;
end = input + ilen;
while (curr < end) {
--
2.34.1
More information about the U-Boot
mailing list