From: Jason Gunthorpe <jgg@nvidia.com>
To: Md Haris Iqbal <haris.iqbal@ionos.com>
Cc: linux-rdma@vger.kernel.org, bvanassche@acm.org, leon@kernel.org,
dledford@redhat.com, jinpu.wang@ionos.com,
Gioh Kim <gi-oh.kim@ionos.com>
Subject: Re: [PATCH for-next 2/5] RDMA/rtrs-clt: fix CHECK type warnings
Date: Fri, 28 Jan 2022 10:55:10 -0400 [thread overview]
Message-ID: <20220128145510.GA1792599@nvidia.com> (raw)
In-Reply-To: <20220114154753.983568-3-haris.iqbal@ionos.com>
On Fri, Jan 14, 2022 at 04:47:50PM +0100, Md Haris Iqbal wrote:
> -/**
> - * list_next_or_null_rr_rcu - get next list element in round-robin fashion.
> - * @head: the head for the list.
> - * @ptr: the list head to take the next element from.
> - * @type: the type of the struct this is embedded in.
> - * @memb: the name of the list_head within the struct.
> - *
> - * Next element returned in round-robin fashion, i.e. head will be skipped,
> - * but if list is observed as empty, NULL will be returned.
> - *
> - * This primitive may safely run concurrently with the _rcu list-mutation
> - * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
> - */
> -#define list_next_or_null_rr_rcu(head, ptr, type, memb) \
> -({ \
> - list_next_or_null_rcu(head, ptr, type, memb) ?: \
> - list_next_or_null_rcu(head, READ_ONCE((ptr)->next), \
> - type, memb); \
> -})
Why not put this in a static inline instead of open coding it? Type is
always the same for both usages, right?
Jason
next prev parent reply other threads:[~2022-01-28 14:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 15:47 [PATCH for-next 0/5] Misc update for RTRS Md Haris Iqbal
2022-01-14 15:47 ` [PATCH for-next 1/5] RDMA/rtrs: fix CHECK:BRACES type warning Md Haris Iqbal
2022-01-14 15:47 ` [PATCH for-next 2/5] RDMA/rtrs-clt: fix CHECK type warnings Md Haris Iqbal
2022-01-28 14:55 ` Jason Gunthorpe [this message]
2022-02-07 16:07 ` Haris Iqbal
2022-01-14 15:47 ` [PATCH for-next 3/5] " Md Haris Iqbal
2022-01-14 15:47 ` [PATCH for-next 4/5] RDMA/rtrs-clt: Update one outdated comment in path_it_deinit Md Haris Iqbal
2022-01-14 15:47 ` [PATCH for-next 5/5] RDMA/rtrs-clt: Do stop and failover outside reconnect work Md Haris Iqbal
2022-01-26 13:56 ` [PATCH for-next 0/5] Misc update for RTRS Haris Iqbal
2022-01-28 15:00 ` Jason Gunthorpe
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=20220128145510.GA1792599@nvidia.com \
--to=jgg@nvidia.com \
--cc=bvanassche@acm.org \
--cc=dledford@redhat.com \
--cc=gi-oh.kim@ionos.com \
--cc=haris.iqbal@ionos.com \
--cc=jinpu.wang@ionos.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).