From 43ae4a70257bc4768ff0bec19e7ee79a1657b099 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Wed, 26 Oct 2022 20:34:15 +0200 Subject: [PATCH] checkpatch: Disallow using __BYTE_ORDER__ The canonical way of determining endianness is now CONFIG_BIG_ENDIAN instead in Zephyr. Signed-off-by: Carles Cufi --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 978a05c8a199a3..28f3db25a10021 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6562,6 +6562,12 @@ sub process { "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr); } +# check for uses of __BYTE_ORDER__ + while ($line =~ /\b(__BYTE_ORDER__)\b/g) { + ERROR("BYTE_ORDER", + "Use of the '$1' macro is disallowed. Use CONFIG_BIG_ENDIAN instead\n" . $herecurr); + } + # check for use of yield() if ($line =~ /\byield\s*\(\s*\)/) { WARN("YIELD",