From: Jason Gunthorpe <jgg@ziepe.ca>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Danil Kipnis <danil.kipnis@cloud.ionos.com>,
linux-block@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-next@vger.kernel.org, axboe@kernel.dk, dledford@redhat.com,
leon@kernel.org, jinpu.wang@cloud.ionos.com,
kbuild test robot <lkp@intel.com>
Subject: Re: [PATCH v2] rtrs-clt: silence kbuild test inconsistent intenting smatch warning
Date: Tue, 19 May 2020 20:38:47 -0300 [thread overview]
Message-ID: <20200519233847.GC12656@ziepe.ca> (raw)
In-Reply-To: <76b6b987-4f63-2487-7fbe-a1d9c2f06b76@acm.org>
On Tue, May 19, 2020 at 07:29:15AM -0700, Bart Van Assche wrote:
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index 468fdd0d8713..8dfa56dc32bc 100644
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -727,18 +727,13 @@ struct path_it {
> struct rtrs_clt_sess *(*next_path)(struct path_it *it);
> };
>
> -#define do_each_path(path, clt, it) { \
> - path_it_init(it, clt); \
> - rcu_read_lock(); \
> - for ((it)->i = 0; ((path) = ((it)->next_path)(it)) && \
> - (it)->i < (it)->clt->paths_num; \
> +#define for_each_path(path, clt, it) \
> + for (path_it_init((it), (clt)), rcu_read_lock(), (it)->i = 0; \
> + (((path) = ((it)->next_path)(it)) && \
> + (it)->i < (it)->clt->paths_num) || \
> + (path_it_deinit(it), rcu_read_unlock(), 0); \
> (it)->i++)
That is nicer, even better to write it with some inlines..
Jason
next prev parent reply other threads:[~2020-05-19 23:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 11:29 [PATCH v2] rtrs-clt: silence kbuild test inconsistent intenting smatch warning Danil Kipnis
2020-05-19 14:29 ` Bart Van Assche
2020-05-19 23:38 ` Jason Gunthorpe [this message]
2020-05-20 10:04 ` Danil Kipnis
2020-05-20 19:11 ` Jason Gunthorpe
2020-05-22 5:39 ` [PATCH] RDMA/rtrs: get rid of the do_next_path while_next_path macros Danil Kipnis
2020-05-23 0:24 ` Jason Gunthorpe
2020-05-20 10:02 ` [PATCH v2] rtrs-clt: silence kbuild test inconsistent intenting smatch warning Danil Kipnis
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=20200519233847.GC12656@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=danil.kipnis@cloud.ionos.com \
--cc=dledford@redhat.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=leon@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lkp@intel.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 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).