Skip to content

Commit

Permalink
libfc: Clarify fc_exch_find()
Browse files Browse the repository at this point in the history
The condition ep != NULL && ep->xid != xid can never be met. Make
this explicit.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
  • Loading branch information
Bart Van Assche authored and Robert Love committed Sep 4, 2013
1 parent a84ea8c commit 8d08023
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/libfc/fc_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,10 @@ static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid)
pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask);
spin_lock_bh(&pool->lock);
ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order);
if (ep && ep->xid == xid)
if (ep) {
WARN_ON(ep->xid != xid);
fc_exch_hold(ep);
}
spin_unlock_bh(&pool->lock);
}
return ep;
Expand Down

0 comments on commit 8d08023

Please sign in to comment.