On Thu, May 11, 2023 at 12:12:16PM -0700, Paul E. McKenney wrote: > On Thu, May 11, 2023 at 06:10:00PM +0100, Mark Rutland wrote: > > I think that we can restructure the ifdeffery so that each ordering variant > > gets its own ifdeffery, and then we could place the kerneldoc immediately above > > that, e.g. > > > > /** > > * arch_atomic_inc_return_release() > > * > > * [ full kerneldoc block here ] > > */ > > #if defined(arch_atomic_inc_return_release) > > /* defined in arch code */ > > #elif defined(arch_atomic_inc_return_relaxed) > > [ define in terms of arch_atomic_inc_return_relaxed ] > > #elif defined(arch_atomic_inc_return) > > [ define in terms of arch_atomic_inc_return ] > > #else > > [ define in terms of arch_atomic_fetch_inc_release ] > > #endif > > > > ... with similar for the mandatory ops that each arch must provide, e.g. > > > > /** > > * arch_atomic_or() > > * > > * [ full kerneldoc block here ] > > */ > > /* arch_atomic_or() is mandatory -- architectures must define it! */ > > > > I had a go at that restructuring today, and while local build testing indicates > > I haven't got it quite right, I think it's possible: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=atomics/fallback-rework > > > > Does that sound ok to you? > > At first glance, it appears that your "TODO" locations have the same > information that I was using, so it should not be hard for me to adapt the > current kernel-doc generation to your new scheme. (Famous last words!) Great! > Plus having the kernel-doc generation all in one place does have some > serious attractions. :) > I will continue maintaining my current stack, but would of course be > happy to port it on top of your refactoring. If it turns out that > the refactoring will take a long time, we can discuss what to do in > the meantime. But here is hoping that the refactoring goes smoothly! > That would be easier all around. ;-) FWIW, I think that's working now; every cross-build I've tried works. I've updated the branch at: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=atomics/fallback-rework Tagged as: atomics-fallback-rework-20230512 Thanks, Mark.