From ca62009eff728c0a62ea76184adcc6be411f4066 Mon Sep 17 00:00:00 2001 From: Enze Li Date: Mon, 27 Mar 2023 11:02:37 +0800 Subject: scsi: sr: Simplify the sr_open() function Simplify the sr_open() by removing the goto label as the function only returns one error code. Signed-off-by: Enze Li Link: https://lore.kernel.org/r/20230327030237.3407253-1-lienze@kylinos.cn Reviewed-by: Bart Van Assche Reviewed-by: Benjamin Block Signed-off-by: Martin K. Petersen --- drivers/scsi/sr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers') 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; } static void sr_release(struct cdrom_device_info *cdi) -- cgit v1.2.1