Skip to content

Commit

Permalink
scripts/dtc: dtx_diff - 2nd update of include dts paths to match build
Browse files Browse the repository at this point in the history
Update dtx_diff include paths in the same manner as:
commit b12869a ("of: remove drivers/of/testcase-data from
include search path for CPP"), commit 5ffa2ae ("of: remove
arch/$(SRCARCH)/boot/dts from include search path for CPP"), and
commit 50f9dda ("of: search scripts/dtc/include-prefixes path
for both CPP and DTC").

Remove proposed include path kernel/dts/, which was never implemented
for the dtb build.

For the diff case, each source file is compiled separately.  For
each of those compiles, provide the location of the source file
as an include path, not the location of both source files.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Frank Rowand authored and Rob Herring committed Sep 20, 2017
1 parent a6899e9 commit 35f3c98
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions scripts/dtc/dtx_diff
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ eod
compile_to_dts() {

dtx="$1"
dtc_include="$2"

if [ -d "${dtx}" ] ; then

Expand Down Expand Up @@ -113,7 +114,7 @@ compile_to_dts() {
# ----- input is DTS (source)

if ( cpp ${cpp_flags} -x assembler-with-cpp ${dtx} \
| ${DTC} -I dts ) ; then
| ${DTC} ${dtc_include} -I dts ) ; then
return
fi

Expand Down Expand Up @@ -320,30 +321,25 @@ fi

cpp_flags="\
-nostdinc \
-I${srctree}/arch/${ARCH}/boot/dts \
-I${srctree}/scripts/dtc/include-prefixes \
-I${srctree}/drivers/of/testcase-data \
-undef -D__DTS__"

dtc_flags="\
-i ${srctree}/arch/${ARCH}/boot/dts/ \
-i ${srctree}/kernel/dts \
${dtx_path_1_dtc_include} \
${dtx_path_2_dtc_include}"

DTC="${DTC} ${dtc_flags} -O dts -qq -f ${dtc_sort} -o -"
DTC="\
${DTC} \
-i ${srctree}/scripts/dtc/include-prefixes \
-O dts -qq -f ${dtc_sort} -o -"


# ----- do the diff or decompile

if (( ${cmd_diff} )) ; then

diff ${diff_flags} --label "${dtx_file_1}" --label "${dtx_file_2}" \
<(compile_to_dts "${dtx_file_1}") \
<(compile_to_dts "${dtx_file_2}")
<(compile_to_dts "${dtx_file_1}" "${dtx_path_1_dtc_include}") \
<(compile_to_dts "${dtx_file_2}" "${dtx_path_2_dtc_include}")

else

compile_to_dts "${dtx_file_1}"
compile_to_dts "${dtx_file_1}" "${dtx_path_1_dtc_include}"

fi

0 comments on commit 35f3c98

Please sign in to comment.