mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
Tidy up a few bits:
- Fix typos and grammar, improve wording.
- Remove spurious newlines that are col80 warning artifacts where the
resulting line-break is worse than the disease it's curing.
- Use core kernel coding style to improve readability and reduce
spurious code pattern variations.
- Use better vertical alignment for structure definitions and initialization
sequences.
- Misc other small details.
No change in functionality intended.
Cc: linux-kernel@vger.kernel.org
Cc: Marco Elver <elver@google.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
28 lines
888 B
C
28 lines
888 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _KERNEL_KCSAN_ATOMIC_H
|
|
#define _KERNEL_KCSAN_ATOMIC_H
|
|
|
|
#include <linux/jiffies.h>
|
|
|
|
/*
|
|
* Helper that returns true if access to @ptr should be considered an atomic
|
|
* access, even though it is not explicitly atomic.
|
|
*
|
|
* List all volatile globals that have been observed in races, to suppress
|
|
* data race reports between accesses to these variables.
|
|
*
|
|
* For now, we assume that volatile accesses of globals are as strong as atomic
|
|
* accesses (READ_ONCE, WRITE_ONCE cast to volatile). The situation is still not
|
|
* entirely clear, as on some architectures (Alpha) READ_ONCE/WRITE_ONCE do more
|
|
* than cast to volatile. Eventually, we hope to be able to remove this
|
|
* function.
|
|
*/
|
|
static inline bool kcsan_is_atomic(const volatile void *ptr)
|
|
{
|
|
/* only jiffies for now */
|
|
return ptr == &jiffies;
|
|
}
|
|
|
|
#endif /* _KERNEL_KCSAN_ATOMIC_H */
|