Re: [PATCH] libfdt: include "..." instead of <...> from libfdt.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxx>
> ---
> 
>  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: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux