summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitko Haralanov <mitko.haralanov@intel.com>2016-02-05 11:57:50 -0500
committerDoug Ledford <dledford@redhat.com>2016-02-29 17:10:38 -0500
commitacac10fdd75a85b10a638381127f7bbed632580d (patch)
tree577a9687df29f54766ed4254762bb22e763d2e8f
parenta86cd357e5be1b7eae3b399c02b972a92808c38a (diff)
downloadop-kernel-dev-acac10fdd75a85b10a638381127f7bbed632580d.zip
op-kernel-dev-acac10fdd75a85b10a638381127f7bbed632580d.tar.gz
staging/hfi1: Remove un-needed variable
There is no need to use a separate variable for a return value and a label when returning right away would do just as well. Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/staging/rdma/hfi1/file_ops.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c
index c666935..76fe603 100644
--- a/drivers/staging/rdma/hfi1/file_ops.c
+++ b/drivers/staging/rdma/hfi1/file_ops.c
@@ -1037,22 +1037,19 @@ static int allocate_ctxt(struct file *fp, struct hfi1_devdata *dd,
static int init_subctxts(struct hfi1_ctxtdata *uctxt,
const struct hfi1_user_info *uinfo)
{
- int ret = 0;
unsigned num_subctxts;
num_subctxts = uinfo->subctxt_cnt;
- if (num_subctxts > HFI1_MAX_SHARED_CTXTS) {
- ret = -EINVAL;
- goto bail;
- }
+ if (num_subctxts > HFI1_MAX_SHARED_CTXTS)
+ return -EINVAL;
uctxt->subctxt_cnt = uinfo->subctxt_cnt;
uctxt->subctxt_id = uinfo->subctxt_id;
uctxt->active_slaves = 1;
uctxt->redirect_seq_cnt = 1;
set_bit(HFI1_CTXT_MASTER_UNINIT, &uctxt->event_flags);
-bail:
- return ret;
+
+ return 0;
}
static int setup_subctxt(struct hfi1_ctxtdata *uctxt)
OpenPOWER on IntegriCloud