Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e490974e authored by Jubin John's avatar Jubin John Committed by Doug Ledford
Browse files

staging/rdma/hfi1: Add braces on all arms of statement



Add braces on all arms of statements to fix checkpatch check:
CHECK: braces {} should be used on all arms of this statement

Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarJubin John <jubin.john@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 17fb4f29
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -13829,9 +13829,9 @@ int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt, u16 pkey)
	int ret = 0;
	u64 reg;

	if (ctxt < dd->num_rcv_contexts)
	if (ctxt < dd->num_rcv_contexts) {
		rcd = dd->rcd[ctxt];
	else {
	} else {
		ret = -EINVAL;
		goto done;
	}
@@ -13857,9 +13857,9 @@ int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt)
	int ret = 0;
	u64 reg;

	if (ctxt < dd->num_rcv_contexts)
	if (ctxt < dd->num_rcv_contexts) {
		rcd = dd->rcd[ctxt];
	else {
	} else {
		ret = -EINVAL;
		goto done;
	}
+8 −8
Original line number Diff line number Diff line
@@ -302,9 +302,9 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
			goto drop;

		/* Check for GRH */
		if (lnh == HFI1_LRH_BTH)
		if (lnh == HFI1_LRH_BTH) {
			ohdr = &hdr->u.oth;
		else if (lnh == HFI1_LRH_GRH) {
		} else if (lnh == HFI1_LRH_GRH) {
			u32 vtf;

			ohdr = &hdr->u.l.oth;
@@ -314,9 +314,9 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
			if ((vtf >> IB_GRH_VERSION_SHIFT) != IB_GRH_VERSION)
				goto drop;
			rcv_flags |= HFI1_HAS_GRH;
		} else
		} else {
			goto drop;

		}
		/* Get the destination QP number. */
		qp_num = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
		if (lid < be16_to_cpu(IB_MULTICAST_LID_BASE)) {
@@ -618,14 +618,14 @@ static void __prescan_rxq(struct hfi1_packet *packet)
			hfi1_get_msgheader(dd, rhf_addr);
		lnh = be16_to_cpu(hdr->lrh[0]) & 3;

		if (lnh == HFI1_LRH_BTH)
		if (lnh == HFI1_LRH_BTH) {
			ohdr = &hdr->u.oth;
		else if (lnh == HFI1_LRH_GRH) {
		} else if (lnh == HFI1_LRH_GRH) {
			ohdr = &hdr->u.l.oth;
			grh = &hdr->u.l.grh;
		} else
		} else {
			goto next; /* just in case */

		}
		bth1 = be32_to_cpu(ohdr->bth[1]);
		is_ecn = !!(bth1 & (HFI1_FECN_SMASK | HFI1_BECN_SMASK));

+6 −3
Original line number Diff line number Diff line
@@ -399,8 +399,9 @@ static ssize_t hfi1_file_write(struct file *fp, const char __user *data,
			ret = sc_enable(sc);
			hfi1_rcvctrl(dd, HFI1_RCVCTRL_CTXT_ENB,
				     uctxt->ctxt);
		} else
		} else {
			ret = sc_restart(sc);
		}
		if (!ret)
			sc_return_credits(sc);
		break;
@@ -1409,8 +1410,9 @@ static unsigned int poll_next(struct file *fp,
		set_bit(HFI1_CTXT_WAITING_RCV, &uctxt->event_flags);
		hfi1_rcvctrl(dd, HFI1_RCVCTRL_INTRAVAIL_ENB, uctxt->ctxt);
		pollflag = 0;
	} else
	} else {
		pollflag = POLLIN | POLLRDNORM;
	}
	spin_unlock_irq(&dd->uctxt_lock);

	return pollflag;
@@ -1488,8 +1490,9 @@ static int manage_rcvq(struct hfi1_ctxtdata *uctxt, unsigned subctxt,
		if (uctxt->rcvhdrtail_kvaddr)
			clear_rcvhdrtail(uctxt);
		rcvctrl_op = HFI1_RCVCTRL_CTXT_ENB;
	} else
	} else {
		rcvctrl_op = HFI1_RCVCTRL_CTXT_DIS;
	}
	hfi1_rcvctrl(dd, rcvctrl_op, uctxt->ctxt);
	/* always; new head should be equal to new tail; see above */
bail:
+2 −1
Original line number Diff line number Diff line
@@ -1713,9 +1713,10 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd)
				     rcd->egrbufs.buffers[j].len)) {
					j++;
					offset = 0;
				} else
				} else {
					offset += new_size;
				}
			}
			rcd->egrbufs.rcvtid_size = new_size;
		}
	}
+12 −11
Original line number Diff line number Diff line
@@ -135,15 +135,16 @@ static void send_trap(struct hfi1_ibport *ibp, void *data, unsigned len)
			struct ib_ah *ah;

			ah = hfi1_create_qp0_ah(ibp, ibp->rvp.sm_lid);
			if (IS_ERR(ah))
			if (IS_ERR(ah)) {
				ret = PTR_ERR(ah);
			else {
			} else {
				send_buf->ah = ah;
				ibp->rvp.sm_ah = ibah_to_rvtah(ah);
				ret = 0;
			}
		} else
		} else {
			ret = -EINVAL;
		}
	} else {
		send_buf->ah = &ibp->rvp.sm_ah->ibah;
		ret = 0;
@@ -769,9 +770,9 @@ static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
			p[i] = cpu_to_be16(q[i]);
		if (resp_len)
			*resp_len += size;
	} else
	} else {
		smp->status |= IB_SMP_INVALID_FIELD;

	}
	return reply((struct ib_mad_hdr *)smp);
}

@@ -977,15 +978,15 @@ static int set_port_states(struct hfi1_pportdata *ppd, struct opa_smp *smp,
			break;
		/* FALLTHROUGH */
	case IB_PORT_DOWN:
		if (phys_state == IB_PORTPHYSSTATE_NOP)
		if (phys_state == IB_PORTPHYSSTATE_NOP) {
			link_state = HLS_DN_DOWNDEF;
		else if (phys_state == IB_PORTPHYSSTATE_POLLING) {
		} else if (phys_state == IB_PORTPHYSSTATE_POLLING) {
			link_state = HLS_DN_POLL;
			set_link_down_reason(ppd, OPA_LINKDOWN_REASON_FM_BOUNCE,
					     0, OPA_LINKDOWN_REASON_FM_BOUNCE);
		} else if (phys_state == IB_PORTPHYSSTATE_DISABLED)
		} else if (phys_state == IB_PORTPHYSSTATE_DISABLED) {
			link_state = HLS_DN_DISABLE;
		else {
		} else {
			pr_warn("SubnSet(OPA_PortInfo) invalid physical state 0x%x\n",
				phys_state);
			smp->status |= IB_SMP_INVALID_FIELD;
@@ -1193,9 +1194,9 @@ static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
			set_link_width_downgrade_enabled(ppd, lwe);
			call_link_downgrade_policy = 1;
		}
	} else
	} else {
		smp->status |= IB_SMP_INVALID_FIELD;

	}
	lse = be16_to_cpu(pi->link_speed.enabled);
	if (lse) {
		if (lse & be16_to_cpu(pi->link_speed.supported))
Loading