All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Leonardo Bras Soares Passos <leobras@redhat.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Guo Ren <guoren@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND RFC PATCH v2 1/6] riscv/cmpxchg: Deduplicate cmpxchg() asm functions
Date: Wed, 22 Mar 2023 08:50:42 +0100	[thread overview]
Message-ID: <ZBqzUplarOxIXrvN@andrea> (raw)
In-Reply-To: <CAJ6HWG46-an3r3WH+n8mHHge8SjqgMbohjTmmk=_EXVmwKZSeA@mail.gmail.com>

> > 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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Andrea Parri <parri.andrea@gmail.com>
To: Leonardo Bras Soares Passos <leobras@redhat.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Guo Ren <guoren@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND RFC PATCH v2 1/6] riscv/cmpxchg: Deduplicate cmpxchg() asm functions
Date: Wed, 22 Mar 2023 08:50:42 +0100	[thread overview]
Message-ID: <ZBqzUplarOxIXrvN@andrea> (raw)
In-Reply-To: <CAJ6HWG46-an3r3WH+n8mHHge8SjqgMbohjTmmk=_EXVmwKZSeA@mail.gmail.com>

> > 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

  reply	other threads:[~2023-03-22  7:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  7:42 [RESEND RFC PATCH v2 0/6] Deduplicating RISCV cmpxchg.h macros Leonardo Bras
2023-03-21  7:42 ` Leonardo Bras
2023-03-21  7:42 ` [RESEND RFC PATCH v2 1/6] riscv/cmpxchg: Deduplicate cmpxchg() asm functions Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras
2023-03-22  0:45   ` Andrea Parri
2023-03-22  0:45     ` Andrea Parri
2023-03-22  3:50     ` Leonardo Bras Soares Passos
2023-03-22  3:50       ` Leonardo Bras Soares Passos
2023-03-22  7:50       ` Andrea Parri [this message]
2023-03-22  7:50         ` Andrea Parri
2023-03-21  7:42 ` [RESEND RFC PATCH v2 2/6] riscv/cmpxchg: Deduplicate cmpxchg() macros Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras
2023-03-21  7:42 ` [RESEND RFC PATCH v2 3/6] riscv/cmpxchg: Deduplicate arch_cmpxchg() macros Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras
2023-03-21  7:42 ` [RESEND RFC PATCH v2 4/6] riscv/cmpxchg: Deduplicate xchg() asm functions Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras
2023-03-21  7:42 ` [RESEND RFC PATCH v2 5/6] riscv/cmpxchg: Deduplicate xchg() macros Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras
2023-03-21  7:42 ` [RESEND RFC PATCH v2 6/6] riscv/cmpxchg: Deduplicate arch_xchg() macros Leonardo Bras
2023-03-21  7:42   ` Leonardo Bras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBqzUplarOxIXrvN@andrea \
    --to=parri.andrea@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=guoren@kernel.org \
    --cc=leobras@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.