[PATCH v2 04/26] lib: md5: prepare for CONFIG_IS_ENABLED changes

Troy Kisky troykiskyboundary at gmail.com
Fri Feb 24 19:10:25 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>
---

Changes in v2:
- delay include of linux/kconfig.h to do from Makefile
- as suggested by Simon

 lib/md5.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/md5.c b/lib/md5.c
index 1636ab93661..20d5e87814b 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -29,7 +29,10 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
 #include <watchdog.h>
+#define PET_WDG
+#endif
 #endif /* USE_HOSTCC */
 #include <u-boot/md5.h>
 
@@ -288,14 +291,14 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
 	unsigned int chunk_sz)
 {
 	struct MD5Context context;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
 	const unsigned char *end, *curr;
 	int chunk;
 #endif
 
 	MD5Init(&context);
 
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
 	curr = input;
 	end = input + len;
 	while (curr < end) {
-- 
2.34.1



More information about the U-Boot mailing list