[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/46] checkpatch: volatile with a comment or sig_ato
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 40/46] checkpatch: volatile with a comment or sig_atomic_t is okay |
Date: |
Wed, 20 Dec 2017 18:14:52 +0100 |
From: Marc-André Lureau <address@hidden>
This assumes that the comment gives some justification;
"volatile sig_atomic_t" is also self-explanatory and usually
correct.
Discussed in:
'[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without a
process to debug"'
Suggested-by: Fam Zheng <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/checkpatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 34df753..3dc27d9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2475,8 +2475,11 @@ sub process {
# no volatiles please
my $asm_volatile =
qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
- if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
- ERROR("Use of volatile is usually wrong: see
Documentation/volatile-considered-harmful.txt\n" . $herecurr);
+ if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/ &&
+ $line !~ /sig_atomic_t/ &&
+ !ctx_has_comment($first_line, $linenr)) {
+ my $msg = "Use of volatile is usually wrong, please add
a comment\n" . $herecurr;
+ ERROR($msg);
}
# warn about #if 0
--
1.8.3.1
- [Qemu-devel] [PULL 30/46] hw/mips/boston: Remove workaround for writes to ROM aborting, (continued)
- [Qemu-devel] [PULL 30/46] hw/mips/boston: Remove workaround for writes to ROM aborting, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 31/46] hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 33/46] scsi: replace hex constants with #defines, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 32/46] scsi: provide general-purpose functions to manage sense data, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 37/46] i8259: generalize statistics into common code, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 35/46] i8259: convert DPRINTFs into trace, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 38/46] kvm-i8259: support "info pic" and "info irq", Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 36/46] i8259: use DEBUG_IRQ_COUNT always, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 34/46] Remove legacy -no-kvm-pit option, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 39/46] i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 40/46] checkpatch: volatile with a comment or sig_atomic_t is okay,
Paolo Bonzini <=
- [Qemu-devel] [PULL 43/46] test: add some chardev mux event tests, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 41/46] rcu: reduce more than 7MB heap memory by malloc_trim(), Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 42/46] chardev: fix backend events regression with mux chardev, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 45/46] blockdev: convert qemu-nbd server to QIONetListener, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 44/46] blockdev: convert internal NBD server to QIONetListener, Paolo Bonzini, 2017/12/20
- [Qemu-devel] [PULL 46/46] chardev: convert the socket server to QIONetListener, Paolo Bonzini, 2017/12/20
- Re: [Qemu-devel] [PULL 00/46] First batch of misc patches for QEMU 2.12, Peter Maydell, 2017/12/20