diff options
author | Bart Van Assche <bvanassche@acm.org> | 2013-08-17 22:20:07 +0200 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2013-09-04 22:09:15 +0200 |
commit | 8d08023687e2515f2a48235aed80b6982025cd09 (patch) | |
tree | 8e593e299d722c027e7c5011c91667e438f27373 /drivers/scsi/libfc | |
parent | libfc: Micro-optimize fc_setup_exch_mgr() (diff) | |
download | linux-8d08023687e2515f2a48235aed80b6982025cd09.tar.xz linux-8d08023687e2515f2a48235aed80b6982025cd09.zip |
libfc: Clarify fc_exch_find()
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>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index d0be52ab62c8..f6bb0fbf422f 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -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; |