[PATCH] checkpatch.pl: Report an error for CONFIG_xPL_BUILD in device trees
Simon Glass
sjg at chromium.org
Fri Mar 7 00:31:06 CET 2025
Hi Hendrik,
On Thu, 6 Mar 2025 at 13:16, Hendrik Donner <hd at os-cillation.de> wrote:
>
> 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 at os-cillation.de>
> ---
> scripts/checkpatch.pl | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Reviewed-by: Simon Glass <sjg at chromium.org>
Thanks for doing this. You could also add a test to test_checkpatch.py
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b8eb57f38c7..119916d4c78 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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 {
> --
> 2.43.0
>
More information about the U-Boot
mailing list