Re: [PATCH] scsi: Fix incorrect usage of shost_for_each_device

2020-06-03 Thread Hannes Reinecke
On 5/18/20 9:44 AM, Ye Bin wrote: shost_for_each_device(sdev, shost) \ for ((sdev) = __scsi_iterate_devices((shost), NULL); \ (sdev); \ (sdev) = __scsi_iterate_devices((shost), (sdev))) When terminating shost_for_each_device() iteration with break or return, scs

Re: [PATCH] scsi: Fix incorrect usage of shost_for_each_device

2020-05-19 Thread Martin K. Petersen
On Mon, 18 May 2020 15:44:20 +0800, Ye Bin wrote: > shost_for_each_device(sdev, shost) \ > for ((sdev) = __scsi_iterate_devices((shost), NULL); \ >(sdev); \ >(sdev) = __scsi_iterate_devices((shost), (sdev))) > > When terminating shost_for_each_device() iteration with

Re: [PATCH] scsi: Fix incorrect usage of shost_for_each_device

2020-05-18 Thread Bart Van Assche
On 2020-05-18 00:44, Ye Bin wrote: > shost_for_each_device(sdev, shost) \ > for ((sdev) = __scsi_iterate_devices((shost), NULL); \ >(sdev); \ >(sdev) = __scsi_iterate_devices((shost), (sdev))) > > When terminating shost_for_each_device() iteration with break or return

[PATCH] scsi: Fix incorrect usage of shost_for_each_device

2020-05-18 Thread Ye Bin
shost_for_each_device(sdev, shost) \ for ((sdev) = __scsi_iterate_devices((shost), NULL); \ (sdev); \ (sdev) = __scsi_iterate_devices((shost), (sdev))) When terminating shost_for_each_device() iteration with break or return, scsi_device_put() should be used to pre