Re: [PATCH][next] RDMA/nes: remove redundant check on udata

From: Leon Romanovsky
Date: Mon Mar 04 2019 - 01:36:30 EST


On Sat, Mar 02, 2019 at 11:06:36PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>
> ---
> 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)".

I looked on the change which triggered Coverity warning and looks like
your commit message should include this Fixes line:
Fixes: 899444505473 ("IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs")

Thanks

Attachment: signature.asc
Description: PGP signature