Re: [PATCH] scsi: sr: simplify the sr_open function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/26/23 20:02, Enze Li wrote:
Simplify the sr_open function by removing the goto label as it does only
return one error code.

Signed-off-by: Enze Li <lienze@xxxxxxxxxx>
---
  drivers/scsi/sr.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 9e51dcd30bfd..12869e6d4ebd 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -590,20 +590,15 @@ static int sr_open(struct cdrom_device_info *cdi, int purpose)
  {
  	struct scsi_cd *cd = cdi->handle;
  	struct scsi_device *sdev = cd->device;
-	int retval;
/*
  	 * If the device is in error recovery, wait until it is done.
  	 * If the device is offline, then disallow any access to it.
  	 */
-	retval = -ENXIO;
  	if (!scsi_block_when_processing_errors(sdev))
-		goto error_out;
+		return -ENXIO;
return 0;
-
-error_out:
-	return retval;	
  }

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux