[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 3/6] checkpatch: add qemu_bh_new/aio_bh_new checks
From: |
Alexander Bulekov |
Subject: |
[PATCH v7 3/6] checkpatch: add qemu_bh_new/aio_bh_new checks |
Date: |
Mon, 13 Mar 2023 04:24:14 -0400 |
Advise authors to use the _guarded versions of the APIs, instead.
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d768171dcf..eeaec436eb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2865,6 +2865,14 @@ sub process {
if ($line =~ /\bsignal\s*\(/ && !($line =~ /SIG_(?:IGN|DFL)/)) {
ERROR("use sigaction to establish signal handlers;
signal is not portable\n" . $herecurr);
}
+# recommend qemu_bh_new_guarded instead of qemu_bh_new
+ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\bqemu_bh_new\s*\(/) {
+ ERROR("use qemu_bh_new_guarded() instead of
qemu_bh_new() to avoid reentrancy problems\n" . $herecurr);
+ }
+# recommend aio_bh_new_guarded instead of aio_bh_new
+ 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 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);
--
2.39.0
- [PATCH v7 0/6] memory: prevent dma-reentracy issues, Alexander Bulekov, 2023/03/13
- [PATCH v7 2/6] async: Add an optional reentrancy guard to the BH API, Alexander Bulekov, 2023/03/13
- [PATCH v7 3/6] checkpatch: add qemu_bh_new/aio_bh_new checks,
Alexander Bulekov <=
- [PATCH v7 5/6] memory: Allow disabling re-entrancy checking per-MR, Alexander Bulekov, 2023/03/13
- [PATCH v7 4/6] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded, Alexander Bulekov, 2023/03/13
- [PATCH v7 6/6] lsi53c895a: disable reentrancy detection for script RAM, Alexander Bulekov, 2023/03/13
- Re: [PATCH v7 0/6] memory: prevent dma-reentracy issues, Thomas Huth, 2023/03/13