summaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2023-10-13 10:15:46 +0200
committerIngo Molnar <mingo@kernel.org>2023-10-14 11:06:15 +0200
commit886ee55eabac0d46faf8bc0b22207ca2740847ba (patch)
treec8a64934abca06127367ecafcb68805206f78688 /arch/alpha
parentac8b60be078abebc3ab8836f3f0ecac6980e0b4f (diff)
locking/seqlock: Propagate 'const' pointers within read-only methods, remove forced type casts
Currently __seqprop_ptr() is an inline function that must chose to either use 'const' or non-const seqcount related pointers - but this results in the undesirable loss of 'const' propagation, via a forced type cast. The easiest solution would be to turn the pointer wrappers into macros that pass through whatever type is passed to them - but the clever maze of seqlock API instantiation macros relies on the GCC CPP '##' macro extension, which isn't recursive, so inline functions must be used here. So create two wrapper variants instead: 'ptr' and 'const_ptr', and pick the right one for the codepaths that are const: read_seqcount_begin() and read_seqcount_retry(). This cleans up type handling and allows the removal of all type forcing. No change in functionality. Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Waiman Long <longman@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'arch/alpha')
0 files changed, 0 insertions, 0 deletions