[PATCH v1 06/24] lib: sha512: prepare for CONFIG_IS_ENABLED changes

Troy Kisky troykiskyboundary at gmail.com
Wed Feb 22 02:38:03 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>
---

 lib/sha512.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/sha512.c b/lib/sha512.c
index fbe8d5f5bfe..4db2e5c08e4 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -13,7 +13,11 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <linux/string.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
 #else
+#include <linux/kconfig.h>
 #include <string.h>
 #endif /* USE_HOSTCC */
 #include <compiler.h>
@@ -292,7 +296,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 +304,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 +359,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 +367,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) {
-- 
2.34.1



More information about the U-Boot mailing list