diff mbox series

[06/23] image: remove redundant hash includes

Message ID 20240416190019.81016-7-raymond.mao@linaro.org
State RFC
Delegated to: Tom Rini
Headers show
Series Integrate MbedTLS v3.6 LTS with U-Boot | expand

Commit Message

Raymond Mao April 16, 2024, 7 p.m. UTC
Remove the redundant includes of u-boot/md5.h, u-boot/sha1.h,
u-boot/sha256.h and u-boot/sha512.h

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
---
 boot/image-fit.c | 4 ----
 boot/image.c     | 2 --
 2 files changed, 6 deletions(-)

Comments

Tom Rini April 16, 2024, 7:19 p.m. UTC | #1
On Tue, Apr 16, 2024 at 12:00:02PM -0700, Raymond Mao wrote:

> Remove the redundant includes of u-boot/md5.h, u-boot/sha1.h,
> u-boot/sha256.h and u-boot/sha512.h
> 
> Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> ---
>  boot/image-fit.c | 4 ----
>  boot/image.c     | 2 --
>  2 files changed, 6 deletions(-)

Can you please explain how these are redundant? It's not clear, thanks.
Raymond Mao April 17, 2024, 12:13 a.m. UTC | #2
Hi Tom,

On Tue, 16 Apr 2024 at 15:19, Tom Rini <trini@konsulko.com> wrote:

> On Tue, Apr 16, 2024 at 12:00:02PM -0700, Raymond Mao wrote:
>
> > Remove the redundant includes of u-boot/md5.h, u-boot/sha1.h,
> > u-boot/sha256.h and u-boot/sha512.h
> >
> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> > ---
> >  boot/image-fit.c | 4 ----
> >  boot/image.c     | 2 --
> >  2 files changed, 6 deletions(-)
>
> Can you please explain how these are redundant? It's not clear, thanks.
>
> Both image.c and image-fit.c include image.h that
includes <u-boot/hash-checksum.h>.
So we don't need to explicitly repeat "#include <u-boot/<digest>.h>" in
both files.

Thanks and regards,
Raymond
Tom Rini April 17, 2024, 12:19 a.m. UTC | #3
On Tue, Apr 16, 2024 at 08:13:53PM -0400, Raymond Mao wrote:
> Hi Tom,
> 
> On Tue, 16 Apr 2024 at 15:19, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Tue, Apr 16, 2024 at 12:00:02PM -0700, Raymond Mao wrote:
> >
> > > Remove the redundant includes of u-boot/md5.h, u-boot/sha1.h,
> > > u-boot/sha256.h and u-boot/sha512.h
> > >
> > > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> > > ---
> > >  boot/image-fit.c | 4 ----
> > >  boot/image.c     | 2 --
> > >  2 files changed, 6 deletions(-)
> >
> > Can you please explain how these are redundant? It's not clear, thanks.
> >
> > Both image.c and image-fit.c include image.h that
> includes <u-boot/hash-checksum.h>.
> So we don't need to explicitly repeat "#include <u-boot/<digest>.h>" in
> both files.

OK, so lets move this to a prep series patch then please, and then later
<u-boot/hash-checksum.h> can if/as needed get the right headers for
mbedtls or not.
diff mbox series

Patch

diff --git a/boot/image-fit.c b/boot/image-fit.c
index 89e377563c..1efc39f440 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -38,10 +38,6 @@  DECLARE_GLOBAL_DATA_PTR;
 #include <image.h>
 #include <bootstage.h>
 #include <u-boot/crc.h>
-#include <u-boot/md5.h>
-#include <u-boot/sha1.h>
-#include <u-boot/sha256.h>
-#include <u-boot/sha512.h>
 
 /*****************************************************************************/
 /* New uImage format routines */
diff --git a/boot/image.c b/boot/image.c
index 073931cd7a..e57d6eae52 100644
--- a/boot/image.c
+++ b/boot/image.c
@@ -26,8 +26,6 @@ 
 #endif
 
 #include <asm/global_data.h>
-#include <u-boot/md5.h>
-#include <u-boot/sha1.h>
 #include <linux/errno.h>
 #include <asm/io.h>