[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/28] checkpatch: Eliminate false positive in case o
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/28] checkpatch: Eliminate false positive in case of space before square bracket in a definition |
Date: |
Tue, 16 Feb 2016 17:34:20 +0100 |
From: Leonid Bloch <address@hidden>
Now, macro definition such as "#define abc(x) [x] = y" should pass
without an error.
Signed-off-by: Leonid Bloch <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e71c3d1..c26f76e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1716,11 +1716,13 @@ sub process {
# 2. at the beginning of a line for slice initialisers -- [0...10] = 5,
# 3. inside a curly brace -- = { [0...10] = 5 }
# 4. after a comma -- [1] = 5, [2] = 6
+# 5. in a macro definition -- #define abc(x) [x] = y
while ($line =~ /(.*?\s)\[/g) {
my ($where, $prefix) = ($-[1], $1);
if ($prefix !~ /$Type\s+$/ &&
($where != 0 || $prefix !~ /^.\s+$/) &&
$prefix !~ /{\s+$/ &&
+ $prefix !~ /\#\s*define[^(]*\([^)]*\)\s+$/ &&
$prefix !~ /,\s+$/) {
ERROR("space prohibited before open square
bracket '['\n" . $herecurr);
}
--
2.5.0
- [Qemu-devel] [PULL 00/28] Bug fixes + NBD-over-TLS support patches for 2016-02-16, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 01/28] checkpatch: Eliminate false positive in case of comma-space-square bracket, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 02/28] checkpatch: Eliminate false positive in case of space before square bracket in a definition,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/28] Revert "qemu-char: Keep pty slave file descriptor open until the master is closed", Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 05/28] build: Don't redefine 'inline', Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 06/28] vl: change QEMU state machine for system reset, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 08/28] migration: fix incorrect memory_global_dirty_log_start outside BQL, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 07/28] vl: fix migration from prelaunch state, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 12/28] ipmi: sensor number should not exceed MAX_SENSORS, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 10/28] mptsas: fix memory leak, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 11/28] mptsas: fix wrong formula, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 09/28] mptsas: add missing va_end, Paolo Bonzini, 2016/02/16