]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/sha256.c
lib/sha256: fix compile on some hosts
[karo-tx-uboot.git] / lib / sha256.c
index 7348162575ceaccda1fa0100298e47e2f0e25af9..b1085ea791759128dad36cc338bb8430d5389a32 100644 (file)
@@ -8,9 +8,11 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <linux/string.h>
+#else
+#include <string.h>
 #endif /* USE_HOSTCC */
 #include <watchdog.h>
-#include <linux/string.h>
 #include <sha256.h>
 
 /*
@@ -258,14 +260,15 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
 {
        sha256_context ctx;
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-       unsigned char *end, *curr;
+       const unsigned char *end;
+       unsigned char *curr;
        int chunk;
 #endif
 
        sha256_starts(&ctx);
 
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-       curr = input;
+       curr = (unsigned char *)input;
        end = input + ilen;
        while (curr < end) {
                chunk = end - curr;