Commit bda94e32 authored by Ralph Campbell's avatar Ralph Campbell Committed by Roland Dreier

IB/ipath: Remove redundant link state checks

This patch removes some redundant checks when the SMA changes the link
state since the same checks are made in the lower level function that
sets the state.
Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 49739b3e
...@@ -402,7 +402,6 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, ...@@ -402,7 +402,6 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
struct ib_event event; struct ib_event event;
struct ipath_ibdev *dev; struct ipath_ibdev *dev;
struct ipath_devdata *dd; struct ipath_devdata *dd;
u32 flags;
char clientrereg = 0; char clientrereg = 0;
u16 lid, smlid; u16 lid, smlid;
u8 lwe; u8 lwe;
...@@ -541,7 +540,6 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, ...@@ -541,7 +540,6 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
* is down or is being set to down. * is down or is being set to down.
*/ */
state = pip->linkspeed_portstate & 0xF; state = pip->linkspeed_portstate & 0xF;
flags = dd->ipath_flags;
lstate = (pip->portphysstate_linkdown >> 4) & 0xF; lstate = (pip->portphysstate_linkdown >> 4) & 0xF;
if (lstate && !(state == IB_PORT_DOWN || state == IB_PORT_NOP)) if (lstate && !(state == IB_PORT_DOWN || state == IB_PORT_NOP))
goto err; goto err;
...@@ -572,13 +570,9 @@ static int recv_subn_set_portinfo(struct ib_smp *smp, ...@@ -572,13 +570,9 @@ static int recv_subn_set_portinfo(struct ib_smp *smp,
ipath_set_linkstate(dd, lstate); ipath_set_linkstate(dd, lstate);
break; break;
case IB_PORT_ARMED: case IB_PORT_ARMED:
if (!(flags & (IPATH_LINKINIT | IPATH_LINKACTIVE)))
break;
ipath_set_linkstate(dd, IPATH_IB_LINKARM); ipath_set_linkstate(dd, IPATH_IB_LINKARM);
break; break;
case IB_PORT_ACTIVE: case IB_PORT_ACTIVE:
if (!(flags & IPATH_LINKARMED))
break;
ipath_set_linkstate(dd, IPATH_IB_LINKACTIVE); ipath_set_linkstate(dd, IPATH_IB_LINKACTIVE);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment