diff mbox series

[v2,11/16] lib/sha*.c: Update header list

Message ID 20231214181658.3359902-11-trini@konsulko.com
State Accepted
Commit bc9c7ccc87bee1659a586171eeb19c7474023095
Delegated to: Tom Rini
Headers show
Series [v2,01/16] qe: Add <config.h> to linux/immap_qe.h | expand

Commit Message

Tom Rini Dec. 14, 2023, 6:16 p.m. UTC
Cleanup the list of headers we include here. For the tools build we only
need to exclude <cyclic.h> as that's used by the target build for the
prototype for schedule(), and we don't need to get that via
<watchdog.h>. We can also make use of our <string.h> intentionally
existing as a redirection to <linux/string.h> to reduce ifdef'd lines.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 lib/sha1.c   | 7 ++-----
 lib/sha256.c | 7 ++-----
 lib/sha512.c | 6 +-----
 3 files changed, 5 insertions(+), 15 deletions(-)

Comments

Simon Glass Dec. 16, 2023, 6:45 p.m. UTC | #1
On Thu, 14 Dec 2023 at 11:18, Tom Rini <trini@konsulko.com> wrote:
>
> Cleanup the list of headers we include here. For the tools build we only
> need to exclude <cyclic.h> as that's used by the target build for the
> prototype for schedule(), and we don't need to get that via
> <watchdog.h>. We can also make use of our <string.h> intentionally
> existing as a redirection to <linux/string.h> to reduce ifdef'd lines.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  lib/sha1.c   | 7 ++-----
>  lib/sha256.c | 7 ++-----
>  lib/sha512.c | 6 +-----
>  3 files changed, 5 insertions(+), 15 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/lib/sha1.c b/lib/sha1.c
index 8d0740789349..7ef536f4b5db 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -17,12 +17,9 @@ 
 #endif
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
-#include <watchdog.h>
+#include <string.h>
 #include <u-boot/sha1.h>
 
 #include <linux/compiler_attributes.h>
diff --git a/lib/sha256.c b/lib/sha256.c
index 4d26aea1c8ce..665ba6f152e5 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -6,12 +6,9 @@ 
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
-#include <watchdog.h>
+#include <string.h>
 #include <u-boot/sha256.h>
 
 #include <linux/compiler_attributes.h>
diff --git a/lib/sha512.c b/lib/sha512.c
index fbe8d5f5bfe9..ffe2c5cd9642 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -11,13 +11,9 @@ 
  */
 
 #ifndef USE_HOSTCC
-#include <common.h>
-#include <linux/string.h>
-#else
-#include <string.h>
+#include <cyclic.h>
 #endif /* USE_HOSTCC */
 #include <compiler.h>
-#include <watchdog.h>
 #include <u-boot/sha512.h>
 
 const uint8_t sha384_der_prefix[SHA384_DER_LEN] = {