[RESEND RFC PATCH v2 1/6] riscv/cmpxchg: Deduplicate cmpxchg() asm functions

Andrea Parri parri.andrea at gmail.com
Wed Mar 22 00:50:42 PDT 2023


> > Though I'm not really a fan of macros depending on local variables with
> > "magic" names, can this be avoided?
> 
> You mean __ret, __rc, __ptr, __old and __new ?

Indeed, the wording was from coding-style.rst


> If so, yes, we could add them to the macro signature, but it would
> become quite big with not much to gain. To reduce impact it could be
> something like:
> 
> +#define ___cmpxchg(lr_sfx, sc_sfx, prepend, append, ret, r, p, o, n)
> 
> Is this a possible fix?

I believe that'll do it, open to other approaches.

  Andrea



More information about the linux-riscv mailing list