linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCHv2 1/5] dtc: Use quotes to include header files
Date: Sat, 27 Dec 2014 20:08:32 -0600	[thread overview]
Message-ID: <CAL_JsqLegL1jT4rtNtum1RabXvd3NbS_G1EkkVjCcN-aPg975A@mail.gmail.com> (raw)
In-Reply-To: <1419369212-17047-2-git-send-email-chris.packham@alliedtelesis.co.nz>

On Tue, Dec 23, 2014 at 3:13 PM, Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
> Currently in arch and driver code that needs early access to the
> flattened device tree it is necessary to add specific CFLAGS so that
> when scripts/dtc/libfdt/libfdt.h is included the C preprocessor is able
> to locate the libfdt versions of libfdt_env.h and fdt.h without
> generating an error.
>
> We already provide an alternative linux-specific
> version of libfdt_env.h and directly include scripts/dtc/libfdt/fdt.h
> so the inclusion by scripts/dtc/libfdt/libfdt.h is a no-op thanks to the
> inclusion guards.
>
> By using quotes in scripts/dtc/libfdt/libfdt.h it picks up fdt.h and
> libfdt_env.h from the source directory without needing to add CFLAGS for
> the sources that happen to include linux/libfdt.h.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> For the files that include linux/libfdt.h we currently also have to
> specify additional CFLAGS to satisfy the CPP.
>
>   $ git grep '<linux/libfdt.h>'
>   arch/mips/cavium-octeon/octeon-platform.c:#include <linux/libfdt.h>
>   arch/mips/cavium-octeon/setup.c:#include <linux/libfdt.h>
>   arch/mips/mti-sead3/sead3-setup.c:#include <linux/libfdt.h>
>   arch/powerpc/kernel/prom.c:#include <linux/libfdt.h>
>   drivers/firmware/efi/libstub/fdt.c:#include <linux/libfdt.h>
>   drivers/of/fdt.c:#include <linux/libfdt.h>
>   drivers/of/fdt_address.c:#include <linux/libfdt.h>
>
>   $ git grep -e '-I.*dtc/libfdt'
>   arch/mips/cavium-octeon/Makefile:CFLAGS_octeon-platform.o = -I$(src)/../../../scripts/dtc/libfdt
>   arch/mips/cavium-octeon/Makefile:CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt
>   arch/mips/mti-sead3/Makefile:CFLAGS_sead3-setup.o = -I$(src)/../../../scripts/dtc/libfdt
>   arch/powerpc/kernel/Makefile:CFLAGS_prom.o              = -I$(src)/../../../scripts/dtc/libfdt
>   drivers/firmware/efi/libstub/Makefile:CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/
>   drivers/of/Makefile:CFLAGS_fdt.o = -I$(src)/../../scripts/dtc/libfdt
>   drivers/of/Makefile:CFLAGS_fdt_address.o = -I$(src)/../../scripts/dtc/libfdt
>   lib/Makefile:   $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
>
> Simply by switching to using quotes we can avoid having this extra step.

Nice, but I would like to see all of these CFLAGS removed as well.

>  scripts/dtc/libfdt/libfdt.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

This is an import of dtc/libfdt and patches to it should be sent
upstream and to devicetree-compiler list.

Rob

> diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
> index 73f4975..ea1ddcd 100644
> --- a/scripts/dtc/libfdt/libfdt.h
> +++ b/scripts/dtc/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    0x10
>  #define FDT_LAST_SUPPORTED_VERSION     0x11
> --
> 2.2.0.rc0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2014-12-28  2:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 21:13 [RFC/PATCHv2 0/5] Add support for Marvell's RD-DXBC2 Chris Packham
2014-12-23 21:13 ` [RFC/PATCHv2 1/5] dtc: Use quotes to include header files Chris Packham
2014-12-28  2:08   ` Rob Herring [this message]
2015-01-02 21:21     ` Chris Packham
2014-12-23 21:13 ` [RFC/PATCHv2 2/5] ARM: mvebu: use dt_fixup to provide fallback for enable-method Chris Packham
2014-12-28  2:53   ` Rob Herring
2015-01-02 21:51     ` Chris Packham
2014-12-23 21:13 ` [RFC/PATCHv2 3/5] clk: mvebu: armada-xp: Support for 98DX4251 Chris Packham
2014-12-23 21:13 ` [RFC/PATCHv2 4/5] ARM: mvebu: Initial support for rd-dxbc2 Chris Packham
2014-12-23 21:13 ` [RFC/PATCHv2 5/5] ARM: mvebu: Custom smp_ops for 98DX4251 Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL_JsqLegL1jT4rtNtum1RabXvd3NbS_G1EkkVjCcN-aPg975A@mail.gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).