]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
checkpatch.pl: Report an error for CONFIG_xPL_BUILD in device trees
authorHendrik Donner <hd@os-cillation.de>
Thu, 6 Mar 2025 20:15:39 +0000 (21:15 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 18 Mar 2025 14:17:36 +0000 (08:17 -0600)
The defines for the different build phases shouldn't be used in device
trees, currently they aren't even defined for device tree pre processing,
resulting in build errors.

Link: https://lists.denx.de/pipermail/u-boot/2025-March/582787.html
Signed-off-by: Hendrik Donner <hd@os-cillation.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
scripts/checkpatch.pl

index f9f8891c0c4995100c07476ab997ec1c2646613f..414019c5b896454b8b5d71b36bcddf26bfbf2c4c 100755 (executable)
@@ -2692,6 +2692,12 @@ sub u_boot_line {
                ERROR("PRE_SCHEMA",
                      "Driver model schema uses 'bootph-...' tags now\n" . $herecurr);
        }
+
+       # Do not allow CONFIG_xPL_BUILD in device trees
+       if ($realfile =~ /\.dtsi?$/ && $line =~ /^\+.*CONFIG_(X|S|T|V)PL_BUILD.*/) {
+               ERROR("CONFIG_xPL_BUILD",
+                     "Do not use CONFIG_xPL_BUILD in device trees\n" . $herecurr);
+       }
 }
 
 sub exclude_global_initialisers {