Skip to content

Commit d41da75

Browse files
RobinKastbergfabiobaltieri
authored andcommitted
checkpatch: Allow __BYTE_ORDER__ and __aligned__ in toolchain files
Checkpatch needs to allow toolchain headers where these macros are defined. Signed-off-by: Robin Kastberg <[email protected]>
1 parent f5a1585 commit d41da75

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6050,6 +6050,7 @@ sub process {
60506050

60516051
# Check for __attribute__ aligned, prefer __aligned
60526052
if ($realfile !~ m@\binclude/uapi/@ &&
6053+
$realfile !~ m@\binclude/zephyr/toolchain@ &&
60536054
$line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
60546055
WARN("PREFER_ALIGNED",
60556056
"__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr);
@@ -6565,9 +6566,10 @@ sub process {
65656566
}
65666567

65676568
# check for uses of __BYTE_ORDER__
6568-
while ($line =~ /\b(__BYTE_ORDER__)\b/g) {
6569-
ERROR("BYTE_ORDER",
6570-
"Use of the '$1' macro is disallowed. Use CONFIG_(BIG|LITTLE)_ENDIAN instead\n" . $herecurr);
6569+
while ($realfile !~ m@^include/zephyr/toolchain@ &&
6570+
$line =~ /\b(__BYTE_ORDER__)\b/g) {
6571+
ERROR("BYTE_ORDER",
6572+
"Use of the '$1' macro is disallowed. Use CONFIG_(BIG|LITTLE)_ENDIAN instead\n" . $herecurr);
65716573
}
65726574

65736575
# check for use of yield()

0 commit comments

Comments
 (0)