mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
IB/hfi1: Fix code consistency for if/else blocks in chip.c
Code structure is not consistent for if/else blocks and break instructions in set_link_state for case HLS_UP_INIT. Physical state uses break in case of an error and if/else blocks for logical use cases. These blocks should be implemented consistently. Reviewed-by: Jakub Byczkowski <jakub.byczkowski@intel.com> Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
bf90aadd63
commit
59ec873695
1 changed files with 12 additions and 11 deletions
|
@ -10569,18 +10569,19 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
|
|||
dd_dev_err(dd,
|
||||
"%s: logical state did not change to INIT\n",
|
||||
__func__);
|
||||
} else {
|
||||
/* clear old transient LINKINIT_REASON code */
|
||||
if (ppd->linkinit_reason >= OPA_LINKINIT_REASON_CLEAR)
|
||||
ppd->linkinit_reason =
|
||||
OPA_LINKINIT_REASON_LINKUP;
|
||||
|
||||
/* enable the port */
|
||||
add_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
|
||||
|
||||
handle_linkup_change(dd, 1);
|
||||
ppd->host_link_state = HLS_UP_INIT;
|
||||
break;
|
||||
}
|
||||
|
||||
/* clear old transient LINKINIT_REASON code */
|
||||
if (ppd->linkinit_reason >= OPA_LINKINIT_REASON_CLEAR)
|
||||
ppd->linkinit_reason =
|
||||
OPA_LINKINIT_REASON_LINKUP;
|
||||
|
||||
/* enable the port */
|
||||
add_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
|
||||
|
||||
handle_linkup_change(dd, 1);
|
||||
ppd->host_link_state = HLS_UP_INIT;
|
||||
break;
|
||||
case HLS_UP_ARMED:
|
||||
if (ppd->host_link_state != HLS_UP_INIT)
|
||||
|
|
Loading…
Add table
Reference in a new issue