From: Jason Gunthorpe <jgg@ziepe.ca>
To: Danil Kipnis <danil.kipnis@cloud.ionos.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
linux-block@vger.kernel.org, linux-rdma@vger.kernel.org,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>, Doug Ledford <dledford@redhat.com>,
Leon Romanovsky <leon@kernel.org>,
Jinpu Wang <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: Wed, 20 May 2020 16:11:05 -0300 [thread overview]
Message-ID: <20200520191105.GK31189@ziepe.ca> (raw)
In-Reply-To: <CAHg0Huy3JmK=iFSrEFhbv==KFJusNr6Z+=H7Xwf+fHEZU2pYmQ@mail.gmail.com>
On Wed, May 20, 2020 at 12:04:28PM +0200, Danil Kipnis wrote:
> On Wed, May 20, 2020 at 1:38 AM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> >
> > 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..
>
> You mean pass a callback to an inline function that would iterate?
no, just wrap some of that logic embedded in the for statement in some
inlines, not sure
Jason
next prev parent reply other threads:[~2020-05-20 19:11 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
2020-05-20 10:04 ` Danil Kipnis
2020-05-20 19:11 ` Jason Gunthorpe [this message]
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=20200520191105.GK31189@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).