[PATCH 18/19] linux/include: add non-atomic version of xchg

2022-12-22 Thread Andrzej Hajda
The pattern of setting variable with new value and returning old one is very common in kernel. Usually atomicity of the operation is not required, so xchg seems to be suboptimal and confusing in such cases. Signed-off-by: Andrzej Hajda --- include/linux/non-atomic/xchg.h | 19

Re: [PATCH 18/19] linux/include: add non-atomic version of xchg

2022-12-22 Thread Andy Shevchenko
On Thu, Dec 22, 2022 at 12:46:34PM +0100, Andrzej Hajda wrote: > The pattern of setting variable with new value and returning old > one is very common in kernel. Usually atomicity of the operation > is not required, so xchg seems to be suboptimal and confusing in > such cases. FWIW, Reviewed-by: