Message ID | 20200528163625.110184-3-hare@suse.de (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | scsi: use xarray for devices and targets | expand |
On 2020-05-28 09:36, Hannes Reinecke wrote: > Instead of walking the list of devices manually use the helper > function to return the device directly. Reviewed-by: Bart van Assche <bvanassche@acm.org>
On Thu, May 28, 2020 at 06:36:23PM +0200, Hannes Reinecke wrote: > Instead of walking the list of devices manually use the helper > function to return the device directly. > > Signed-off-by: Hannes Reinecke <hare@suse.de> > Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Daniel Wagner <dwagner@suse.de>
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 4e37fa9b409d..38799e47b590 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -496,11 +496,9 @@ static int pscsi_configure_device(struct se_device *dev) } spin_lock_irq(sh->host_lock); - list_for_each_entry(sd, &sh->__devices, siblings) { - if ((pdv->pdv_channel_id != sd->channel) || - (pdv->pdv_target_id != sd->id) || - (pdv->pdv_lun_id != sd->lun)) - continue; + sd = __scsi_device_lookup(sh, pdv->pdv_channel_id, + pdv->pdv_target_id, pdv->pdv_lun_id); + if (sd) { /* * Functions will release the held struct scsi_host->host_lock * before calling calling pscsi_add_device_to_list() to register