On Mon, Feb 18, 2019 at 11:19:19AM +0200, Yuval Shaia wrote: > old_pd is used only if IB_MR_REREG_PD flags is set. > For readability move it's initialization to where it is used. > > Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx> > --- > drivers/infiniband/core/uverbs_cmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c > index d4f1a2ef5015..8d749bdcbdcd 100644 > --- a/drivers/infiniband/core/uverbs_cmd.c > +++ b/drivers/infiniband/core/uverbs_cmd.c > @@ -810,12 +810,12 @@ static int ib_uverbs_rereg_mr(struct uverbs_attr_bundle *attrs) > } > } > > - old_pd = mr->pd; > ret = mr->device->ops.rereg_user_mr(mr, cmd.flags, cmd.start, > cmd.length, cmd.hca_va, > cmd.access_flags, pd, > &attrs->driver_udata); > if (!ret) { > + old_pd = mr->pd; > if (cmd.flags & IB_MR_REREG_PD) { > atomic_inc(&pd->usecnt); > mr->pd = pd; Can you you please rewrite the whole if(!ret) .. else construction? if (ret) goto put_uobj_pd if (cmd.flags & IB_MR_REREG_PD) { struct ib_pd *old_pd = mr->pd; ...... } Thanks > -- > 2.20.1 >
Attachment:
signature.asc
Description: PGP signature