Skip to content

Commit

Permalink
scsi: qla2xxx: Rework key encoding in qlt_find_host_by_d_id()
Browse files Browse the repository at this point in the history
Use the same approach for encoding the destination ID as the approach used
by qlt_update_vp_map().

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Bart Van Assche authored and Martin K. Petersen committed Aug 13, 2019
1 parent 0f8243e commit aa20e38
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/scsi/qla2xxx/qla_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,14 @@ struct scsi_qla_host *qlt_find_host_by_d_id(struct scsi_qla_host *vha,
be_id_t d_id)
{
struct scsi_qla_host *host;
uint32_t key = 0;
uint32_t key;

if (vha->d_id.b.area == d_id.area &&
vha->d_id.b.domain == d_id.domain &&
vha->d_id.b.al_pa == d_id.al_pa)
return vha;

key = d_id.domain << 16;
key |= d_id.area << 8;
key |= d_id.al_pa;
key = be_to_port_id(d_id).b24;

host = btree_lookup32(&vha->hw->tgt.host_map, key);
if (!host)
Expand Down

0 comments on commit aa20e38

Please sign in to comment.