Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe930108 authored by Prathyush Katukojwala's avatar Prathyush Katukojwala
Browse files

checkpatch: Check to make sure DT property names are lowercase



Property names in DT files should be lowercase. Reports an error
if a property name that has uppercase characters in it is detected.
See following imaginary example:

qcom,venus@aae0000 {
	...
	ClockNames = "core_clk", "iface_clk", "bus_clk";
	...
};

"ClockNames" here is an invalid property name as it contains uppercase
characters.

Change-Id: I8f05e0daa84bc18b95e307c3733d4700ae7fe1b0
Signed-off-by: default avatarPrathyush Katukojwala <pkatukoj@codeaurora.org>
parent 52034352
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2964,12 +2964,17 @@ sub process {
		next if ($realfile !~ /\.(h|c|s|S|pl|sh|dtsi|dts)$/);

# do DT checks:
#       * Property names should be lower-case
#       * Only newline after };

		if ($realfile =~ /\.(dts|dtsi)$/ && $line =~ /^\+/) {
			if($line =~ /\};.+$/) { # check for any characters after };
				ERROR("DT_STYLE", "newline does not follow immediately after };\n" . $herecurr);
			}

			if($line =~ /[0-9a-zA-Z,\._\+\?#]+\s*=/ && $line !~ /[0-9a-z,\._\+\?#]+\s*=/) { # find property names with uppercase characters
				ERROR("DT_PROPERTY_NAME", "property name is not lowercase\n" . $herecurr);
			}
		}

# line length limit (with some exclusions)