mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
compiler-context-analysis: Remove Sparse support
Remove Sparse support as discussed at [1].
The kernel codebase is still scattered with numerous places that try to
appease Sparse's context tracking ("annotation for sparse", "fake out
sparse", "work around sparse", etc.). Eventually, as more subsystems
enable Clang's context analysis, these places will show up and need
adjustment or removal of the workarounds altogether.
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20250207083335.GW7145@noisy.programming.kicks-ass.net/ [1]
Link: https://lore.kernel.org/all/Z6XTKTo_LMj9KmbY@elver.google.com/ [2]
Link: https://patch.msgid.link/20251219154418.3592607-24-elver@google.com
This commit is contained in:
committed by
Peter Zijlstra
parent
4f109baeea
commit
5b63d0ae94
@@ -53,25 +53,6 @@ sure that bitwise types don't get mixed up (little-endian vs big-endian
|
||||
vs cpu-endian vs whatever), and there the constant "0" really _is_
|
||||
special.
|
||||
|
||||
Using sparse for lock checking
|
||||
------------------------------
|
||||
|
||||
The following macros are undefined for gcc and defined during a sparse
|
||||
run to use the "context" tracking feature of sparse, applied to
|
||||
locking. These annotations tell sparse when a lock is held, with
|
||||
regard to the annotated function's entry and exit.
|
||||
|
||||
__must_hold - The specified lock is held on function entry and exit.
|
||||
|
||||
__acquires - The specified lock is held on function exit, but not entry.
|
||||
|
||||
__releases - The specified lock is held on function entry, but not exit.
|
||||
|
||||
If the function enters and exits without the lock held, acquiring and
|
||||
releasing the lock inside the function in a balanced way, no
|
||||
annotation is needed. The three annotations above are for cases where
|
||||
sparse would otherwise report a context imbalance.
|
||||
|
||||
Getting sparse
|
||||
--------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user