* [PATCH] libfdt: include "..." instead of <...> from libfdt.h
@ 2018-03-04 14:08 Masahiro Yamada
2018-03-07 2:39 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2018-03-04 14:08 UTC (permalink / raw)
To: devicetree-compiler, David Gibson
Cc: Rob Herring, devicetree, Masahiro Yamada
Assuming fdt.h, libfdt.h, and libfdt_env.h will be installed to the
same directory, it wouldn't hurt to use #include "..." for inclusion
among installed headers.
This change is useful for cases where those headers do not reside in
the header search paths.
For example, Linux kernel edits these two lines when importing libfdt
(see scripts/dtc/update-dtc-source.sh) It is needed for kernel because
include/linux/libfdt.h is a wrapper of scripts/dtc/libfdt/libfdt.h, and
scripts/dtc/libfdt is not contained in the header search paths.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
libfdt/libfdt.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index c8c00fa..1e27780 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -51,8 +51,8 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <libfdt_env.h>
-#include <fdt.h>
+#include "libfdt_env.h"
+#include "fdt.h"
#define FDT_FIRST_SUPPORTED_VERSION 0x02
#define FDT_LAST_SUPPORTED_VERSION 0x11
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libfdt: include "..." instead of <...> from libfdt.h
2018-03-04 14:08 [PATCH] libfdt: include "..." instead of <...> from libfdt.h Masahiro Yamada
@ 2018-03-07 2:39 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2018-03-07 2:39 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: devicetree-compiler, Rob Herring, devicetree
[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]
On Sun, Mar 04, 2018 at 11:08:04PM +0900, Masahiro Yamada wrote:
> Assuming fdt.h, libfdt.h, and libfdt_env.h will be installed to the
> same directory,
That's very likely for fdt.h and libfdt.h, but not so much for
libfdt_env.h. libfdt is designed so that libfdt_env.h can be replaced
with something suitable for embedding in a different environment, and
in that case it's often inconvenient to put libfdt_env.h in the same
directory (because then it wouldn't be an exact copy of dtc upstream).
> it wouldn't hurt to use #include "..." for inclusion
> among installed headers.
>
> This change is useful for cases where those headers do not reside in
> the header search paths.
The general idea has been that to compile libfdt you should set your
header search paths to something suitable. What situations does that
become difficult or impossible in?
> For example, Linux kernel edits these two lines when importing libfdt
> (see scripts/dtc/update-dtc-source.sh) It is needed for kernel because
> include/linux/libfdt.h is a wrapper of scripts/dtc/libfdt/libfdt.h, and
> scripts/dtc/libfdt is not contained in the header search paths.
Oh, yuck. I hadn't realised the kernel was using such a gross hack.
We need to find a better way, but I'm not certain if this is it.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> libfdt/libfdt.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
> index c8c00fa..1e27780 100644
> --- a/libfdt/libfdt.h
> +++ b/libfdt/libfdt.h
> @@ -51,8 +51,8 @@
> * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> */
>
> -#include <libfdt_env.h>
> -#include <fdt.h>
> +#include "libfdt_env.h"
> +#include "fdt.h"
>
> #define FDT_FIRST_SUPPORTED_VERSION 0x02
> #define FDT_LAST_SUPPORTED_VERSION 0x11
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-07 2:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-04 14:08 [PATCH] libfdt: include "..." instead of <...> from libfdt.h Masahiro Yamada
2018-03-07 2:39 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).