]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
scripts/checkpatch: Check DEVICE_NATIVE_ENDIAN
authorDjordje Todorovic <Djordje.Todorovic@htecgroup.com>
Tue, 18 Nov 2025 08:58:11 +0000 (08:58 +0000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 18 Nov 2025 18:59:36 +0000 (19:59 +0100)
Developers should specify endianess explicitly.

Signed-off-by: Djordje Todorovic <djordje.todorovic@htecgroup.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251118085758.3996513-15-djordje.todorovic@htecgroup.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
scripts/checkpatch.pl

index d0f4537f25e24844a5e3d7dcf90f0955eff63db0..3a9557417f7ea2db87e2f781ed07a6f386b2fce5 100755 (executable)
@@ -3200,6 +3200,10 @@ sub process {
         if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\baio_bh_new\s*\(/) {
                        ERROR("use aio_bh_new_guarded() instead of aio_bh_new() to avoid reentrancy problems\n" . $herecurr);
                }
+# check for DEVICE_NATIVE_ENDIAN, use explicit endianness instead
+               if ($line =~ /\bDEVICE_NATIVE_ENDIAN\b/) {
+                       ERROR("DEVICE_NATIVE_ENDIAN is not allowed, use DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN instead\n" . $herecurr);
+               }
 # check for module_init(), use category-specific init macros explicitly please
                if ($line =~ /^module_init\s*\(/) {
                        ERROR("please use block_init(), type_init() etc. instead of module_init()\n" . $herecurr);