From: Jason Gunthorpe <jgg@nvidia.com>
To: Mark Zhang <markzhang@nvidia.com>
Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
leon@kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] RDMA/cm: fix cond_no_effect.cocci warnings
Date: Tue, 2 Aug 2022 10:52:07 -0300 [thread overview]
Message-ID: <YuksB4Lv9/7Ix5x8@nvidia.com> (raw)
In-Reply-To: <fdc5931f-5794-1770-0a5d-7470965cf390@nvidia.com>
On Tue, Aug 02, 2022 at 10:15:24AM +0800, Mark Zhang wrote:
>
> > Yes, this is a standard pattern for walking tree with priority, we
> > should not obfuscate it.
> >
> > The final else means 'equal' and the first if should ideally be placed
> > there
> >
> > However this function is complicated by the use of the service_mask
> > for equality checking, and it doesn't even work right if the
> > service_mask is not -1.
> >
> > If someone wants to clean this then please go through and eliminate
> > service_mask completely. From what I can see its value is always -1.
> > Three patches:
> > - Remove the service_mask parameter from ib_cm_listen(), all callers
> > use 0
> > - Remove the service_mask parameter from cm_init_listen(), all
> > callers use 0. Inspect and remove cm_id_priv->id.service_mask,
> > it is the constant value ~cpu_to_be64(0) which is a NOP when &'d
> > - Move the test at the top of cm_find_listen() into the final else
> >
>
> I'll do it. For the 3rd one, do you mean a patch like (similar change in
> cm_insert_listen):
Yes
Jason
prev parent reply other threads:[~2022-08-02 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 9:45 [PATCH] RDMA/cm: fix cond_no_effect.cocci warnings Jiapeng Chong
2022-06-14 1:19 ` Mark Zhang
2022-06-24 20:17 ` Jason Gunthorpe
2022-08-02 2:15 ` Mark Zhang
2022-08-02 13:52 ` Jason Gunthorpe [this message]
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=YuksB4Lv9/7Ix5x8@nvidia.com \
--to=jgg@nvidia.com \
--cc=abaci@linux.alibaba.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=markzhang@nvidia.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.