On Wed, Mar 15, 2023 at 02:15:29PM -0700, Tyler Retzlaff wrote:
> This series replaces uses of __atomic_{add,and,or,sub,xor}_fetch with
> __atomic_fetch_{add,and,or,sub,xor} intrinsics where the new value
> is used.
>
> This series is being separated from the other similar series in
> an effort to reduce the chance of mistakes being spotted in review
> since the usages in this case consume the returned / new value.
>
> v2:
> * remove unnecessary casts of signed to unsigned arguments when
> using generic __atomic builtins.
> * remove inappropriate cast of signed negative value on addend.
>
> Tyler Retzlaff (16):
> app/test: use previous value atomic fetch operations
> common/cnxk: use previous value atomic fetch operations
> common/mlx5: use previous value atomic fetch operations
> drivers/event: use previous value atomic fetch operations
> net/af_xdp: use previous value atomic fetch operations
> net/cnxk: use previous value atomic fetch operations
> net/cxgbe: use previous value atomic fetch operations
> net/iavf: use previous value atomic fetch operations
> net/mlx5: use previous value atomic fetch operations
> net/octeontx: use previous value atomic fetch operations
> raw/ifpga: use previous value atomic fetch operations
> bbdev: use previous value atomic fetch operations
> eal: use previous value atomic fetch operations
> ipsec: use previous value atomic fetch operations
> mbuf: use previous value atomic fetch operations
> rcu: use previous value atomic fetch operations
>
I am wondering how we go about ensuring that we don't introduce any more of
these atomic_X_fetch intrinsics. Is there some way we can add a compiler
warning for them or have a checkpatch check, for example?