From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Thu, 9 Jul 2020 09:47:58 +0900 Subject: [PATCH v3 01/13] lib/crypto, efi_loader: avoid multiple inclusions of header files In-Reply-To: <3ec2058f-58cc-85df-421d-101df4b73d97@gmx.de> References: <20200708050203.15230-1-takahiro.akashi@linaro.org> <20200708050203.15230-2-takahiro.akashi@linaro.org> <3ec2058f-58cc-85df-421d-101df4b73d97@gmx.de> Message-ID: <20200709004758.GA1075@laputa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Heinrich, On Wed, Jul 08, 2020 at 12:29:54PM +0200, Heinrich Schuchardt wrote: > On 08.07.20 07:01, AKASHI Takahiro wrote: > > By adding extra symbols, we can now avoid including x509_parser and > > pkcs7_parser.h files multiple times. > > > > Signed-off-by: AKASHI Takahiro > > Suggested-by: Heinrich Schuchardt > > --- > > lib/efi_loader/efi_image_loader.c | 1 + > > lib/efi_loader/efi_signature.c | 1 + > > 2 files changed, 2 insertions(+) > > > > diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c > > index 06a2ebdb9081..5b00fea2f113 100644 > > --- a/lib/efi_loader/efi_image_loader.c > > +++ b/lib/efi_loader/efi_image_loader.c > > @@ -14,6 +14,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID; > > diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c > > index e05c471c61ce..da3818ac62e2 100644 > > --- a/lib/efi_loader/efi_signature.c > > +++ b/lib/efi_loader/efi_signature.c > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > The patch (and the commit message) seems to have been somehow corrupted during my rework. > I would prefer to use > > [PATCH 1/1] lib/crypto: use qualified path for x509_parser.h > https://lists.denx.de/pipermail/u-boot/2020-July/419214.html My point is, as I said before, that we should include a header *directly* if some symbols in that header are used in a given file even though such a header is *indirectly* inherited by another header, pkcs7_parser.h in this case. That way, "#include" explicitly indicates that the C file relies on another header and associated functions. I always take this practice. In this sense, this patch still makes sense. -Takahiro Akashi > > which has the same effect. > > Best regards > > Heinrich