diff mbox series

checkpatch.pl: Make fdt / initrd relocation disabling an error

Message ID 20200820123749.17278-1-trini@konsulko.com
State Accepted
Commit 12178b51c22d07229375f25e39acb0ab7735ff81
Delegated to: Tom Rini
Headers show
Series checkpatch.pl: Make fdt / initrd relocation disabling an error | expand

Commit Message

Tom Rini Aug. 20, 2020, 12:37 p.m. UTC
Entirely disabling relocation of the device tree or initrd is almost
never the right answer.  Doing this by default leads to hard to diagnose
run-time failures.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Tom Rini Aug. 28, 2020, 12:53 p.m. UTC | #1
On Thu, Aug 20, 2020 at 08:37:49AM -0400, Tom Rini wrote:

> Entirely disabling relocation of the device tree or initrd is almost
> never the right answer.  Doing this by default leads to hard to diagnose
> run-time failures.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3932362dbafd..4bed2b0cdc7c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2359,6 +2359,12 @@  sub u_boot_line {
 		ERROR("BARRED_INCLUDE_IN_HDR",
 		      "Avoid including common.h and dm.h in header files\n" . $herecurr);
 	}
+
+	# Do not disable fdt / initrd relocation
+	if ($rawline =~ /.*(fdt|initrd)_high=0xffffffff/) {
+		ERROR("DISABLE_FDT_OR_INITRD_RELOC",
+		     "fdt or initrd relocation disabled at boot time\n" . $herecurr);
+	}
 }
 
 sub process {