mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Colin Ian King <colin.king@canonical.com>
Cc: Faisal Latif <faisal.latif@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] RDMA/nes: remove redundant check on udata
Date: Thu, 7 Mar 2019 19:01:08 +0200	[thread overview]
Message-ID: <20190307170108.GQ1789@mtr-leonro.mtl.com> (raw)
In-Reply-To: <815dea03-ef9a-39c0-3ec5-cdd58a545911@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

On Thu, Mar 07, 2019 at 10:23:28AM +0000, Colin Ian King wrote:
> On 04/03/2019 06:36, Leon Romanovsky wrote:
> > On Sat, Mar 02, 2019 at 11:06:36PM +0000, Colin King wrote:
> >> From: Colin Ian King <colin.king@canonical.com>
> >>
> >> The non-null check on udata is redundant as this check was performed
> >> just a few statements earlier and the check is always true as udata
> >> must be non-null at this point. Remove redundant the check on udata
> >> and the redundant else part that can never be executed.
> >>
> >> Detected by CoverityScan, CID#1477317 ("Logically dead code")
> >>
> >> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> >> ---
> >>  drivers/infiniband/hw/nes/nes_verbs.c | 73 +++++++++++++--------------
> >>  1 file changed, 34 insertions(+), 39 deletions(-)
> >>
> >> diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
> >> index 828e4af3f951..526092d435df 100644
> >> --- a/drivers/infiniband/hw/nes/nes_verbs.c
> >> +++ b/drivers/infiniband/hw/nes/nes_verbs.c
> >> @@ -1039,53 +1039,48 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
> >>  				}
> >>  				if (req.user_qp_buffer)
> >>  					nesqp->nesuqp_addr = req.user_qp_buffer;
> >> -				if (udata) {
> >> -					nesqp->user_mode = 1;
> >
> > It was single place where user_mode was set, you should continue and
> > remove all code which depends on "if (nesqp->user_mode)".
>
> This is not the only place where user_mode is being set; we currently have:

ok, It doesn't matter, I'll clean it later with my memory allocation
conversion patches.

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2019-03-07 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02 23:06 Colin King
2019-03-04  6:36 ` Leon Romanovsky
2019-03-07 10:23   ` Colin Ian King
2019-03-07 17:01     ` Leon Romanovsky [this message]
2019-03-26 15:10 ` 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=20190307170108.GQ1789@mtr-leonro.mtl.com \
    --to=leon@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=dledford@redhat.com \
    --cc=faisal.latif@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.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

Powered by JetHome