diff mbox series

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

Message ID 20230224181047.2775829-5-troykiskyboundary@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series CONFIG_IS_ENABLED vs IS_ENABLED | expand

Commit Message

Troy Kisky Feb. 24, 2023, 6:10 p.m. UTC
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>
---

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 mbox series

Patch

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) {