Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7002736ybi; Mon, 8 Jul 2019 12:28:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNKVr+HgaxRRrPRYq62JaqUVpR0Wl8EnKIEy/cDVqfaMeAWZ6LBB2Ufwo5i0OQv05G0Jg4 X-Received: by 2002:a17:902:2ec5:: with SMTP id r63mr26722352plb.21.1562614114757; Mon, 08 Jul 2019 12:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562614114; cv=none; d=google.com; s=arc-20160816; b=YyNoj6UyjLRtDE3bwVQ/+BL5XsTKSnm9DHtM+s1UkHsEKrLCCpCAHLVI6bo8kEVTZt 4QHU+X+U13K2aeS1i3rZrhWAHAQD3qndzuhMugr5kESSMrQyBctHw+MAPfxW1M+lKeor HWmYU9Kem+diA2mokUrO/73xFFLiro1KNT7A7AlE6uhP72EcnaNATwE4XZIVaDtKsgVq 1uQOUbxJ0HNfrQgLx9ycA6Nj1TyJMTyhsAVhiTz0tE1P9Ldky2pTqeldY6N6H7v+S3q7 cicKsF+7XJBgvukF2anr8IC+iQ8+LNAmN1b1p9vU2+Uu7e1P95B0ZOZ46dtVBmdK8sa9 tD7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uuzMBczhpFd4zcYpjMdhnitg6M+5a5PUQK3Xnc+A9H8=; b=G07HWgmbLf6YfQBwIjuw2rmsFYmOPvGGCQoUOyzUXvikDFfmAmrPBX/vqc6CDzSE+m iqWUJ1DEKY+OufrsNZhtz6U0S+/gRvzOa3v/UvqyZS33E7opFGAsPPsmHuOX9xFupKPO UHa4XB7p+8imOzw3KbX4QSHpWSdGpF3W8o9Lf8kZzd+O6x9X+jaI5kQ/+A1tZt0N+TJT S01R4P6bnUnBjHmiu5ywXjMp+8QnDB+yBVYVxhZPLZPqxR7q/Y4iN0SDb/VIOcnFtfNx YB6HlBgskijNwGOC0/8Q2BrDJlRNfYfhSfQMHPvEfX/enktlwkPpd22xJ3T1R78aoy4l oTjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si19295583pld.359.2019.07.08.12.28.20; Mon, 08 Jul 2019 12:28:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732068AbfGHPEy (ORCPT + 99 others); Mon, 8 Jul 2019 11:04:54 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43071 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730233AbfGHPEx (ORCPT ); Mon, 8 Jul 2019 11:04:53 -0400 Received: by mail-pf1-f195.google.com with SMTP id i189so7745599pfg.10; Mon, 08 Jul 2019 08:04:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uuzMBczhpFd4zcYpjMdhnitg6M+5a5PUQK3Xnc+A9H8=; b=j8J6o81O8Kel0trZLKq/QJTiW8o9fOeSVRjcZ4jVDKP6IzQTQH348leOzEaTap+3PN I1mO0PAi8OCArSZWpzAjCoL09jKyK8q1BcjLRqwzuukGzNnFRnPF43JPKT3zg0dqvQ0b 4HmPKNrRchQAQSr586Nc7tpzJumVLQKh+aQw77MKRJm65iGgXPx5psTwWhn6zVR3jvDT Y/IIfOU6aa8fjZgzu9EGVZmhv5jeCl93oZW7W7/FcNwwcp9wUA8ng+GLlEycbZiWx+gl dTwLaFU6jiUH8vDClP9oq4UVBVIhyawDk3xfxRl6CpIXcXpooiYCvrWHShlNzBoXPEzD iLtQ== X-Gm-Message-State: APjAAAUcl5dj6iOFlAg4qczfv9fpfQJ7fR5OfpdG7LNtsLWwn5RShQiM K5XR1Rz2sWE+csJSo9Bfx7/F55pa X-Received: by 2002:a17:90a:208d:: with SMTP id f13mr25643200pjg.68.1562598292667; Mon, 08 Jul 2019 08:04:52 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id 1sm17843072pfe.102.2019.07.08.08.04.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2019 08:04:51 -0700 (PDT) Subject: Re: [PATCH] scsi: Remove unreachable code To: Ding Xiang , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1562234156-11945-1-git-send-email-dingxiang@cmss.chinamobile.com> From: Bart Van Assche Message-ID: <82794d9a-8f36-7012-da6a-1e05ce2bb3cb@acm.org> Date: Mon, 8 Jul 2019 08:04:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <1562234156-11945-1-git-send-email-dingxiang@cmss.chinamobile.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.