lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <82794d9a-8f36-7012-da6a-1e05ce2bb3cb@acm.org>
Date:   Mon, 8 Jul 2019 08:04:50 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Ding Xiang <dingxiang@...s.chinamobile.com>, jejb@...ux.ibm.com,
        martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: Remove unreachable code

On 7/4/19 2:55 AM, Ding Xiang wrote:
> The return code after switch default is unreachable,
> so remove it.
> 
> Signed-off-by: Ding Xiang <dingxiang@...s.chinamobile.com>
> ---
>   drivers/scsi/scsi_error.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index bfa569f..12180f0 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -1909,7 +1909,6 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
>   	default:
>   		return FAILED;
>   	}
> -	return FAILED;

I'd rather remove the "default: return FAILED;" code than make the above 
change. If status_byte() ever would be changed into an inline function 
that returns an enum then my alternative will allow the compiler to 
verify whether all enum labels have been handled. No such check will be 
performed if the above patch would be applied.

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ