Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3557106pxm; Tue, 1 Mar 2022 00:14:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCUfl2OWqbBOlXLXV6VyWZF6fpvDznX7QdCKOA8YxPYAi0voxbyDWUXXMTO4lRvPlkil1D X-Received: by 2002:a17:90a:d148:b0:1bc:87f6:73b8 with SMTP id t8-20020a17090ad14800b001bc87f673b8mr20626393pjw.231.1646122453662; Tue, 01 Mar 2022 00:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646122453; cv=none; d=google.com; s=arc-20160816; b=Bp7Bgy5mPLG9tccaJ4RUUKOEzMN9fGj6DnVNponk0wyVC1c7cFx0ILzu5eUTeG9nkp U+gKP8/VY2qswgFEEG2qV40FsRw2uyzEZN2j/CAeHsy9CWf9pb/v9ZY7GFHTXkIn5AuV CG76FIYb8pQfEBv8ruKMotCkpf0mTsTQpsjJiEJT5dzRPQIi39uTwm2jbOT+14RULl4b J/FqqS58LPC9xk6TGckjEcKQ/sVg5Wimn19spGClbwaQL44tVeGQiKmShnS9jEU4WBTA KqnmqVc+Q1Iu1c7NxEFf58eMdq/+o1azUh1bzrln1sk2dlNh7pUuBOel/ekqZeOkGMxl FO5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ygCtyBDyViTQxLMk2ZSKjXKqzqwYNj0XEvSWro8xXh8=; b=BNNEN+OAoFlfVJE4tEPLiHPkOUppvJoUR326qe4dYb+mk83bGqpsBSgEu7SPDsVHM3 pEgNCVl9mXfm/kFbqC3cyeR1lGnFwIa9RKmkZWDfF3kAvVI2FibgNPN9ztaVkSwbc0CX 3MIV4RgLGFsFoH8Nij1xaW1iK3COJXGAWsUWOFKi3+vCXumS1lEYX8IPKFkYo1bReGa7 vP/JZ79f2fobPXoxilQYCX0VBdknSPhiFnjCQjJ5axoOzJhkZMHjLEVvbw/r9yfGjyvs f/w4q7xs+uQhigLw48fik0aQZ9WxjRS2XS6zwU5uqgt+AFk7A0SNP9F8O14wbIv5pJ8H Czvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a17090a468200b001bba4104bccsi1825471pjf.87.2022.03.01.00.13.58; Tue, 01 Mar 2022 00:14:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233095AbiCAIFf (ORCPT + 99 others); Tue, 1 Mar 2022 03:05:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232982AbiCAIFe (ORCPT ); Tue, 1 Mar 2022 03:05:34 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F2880917; Tue, 1 Mar 2022 00:04:53 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R361e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0V5vuZaA_1646121890; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V5vuZaA_1646121890) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Mar 2022 16:04:50 +0800 From: Yang Li To: jejb@linux.ibm.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] scsi: Remove ignoring unreachable code warning Date: Tue, 1 Mar 2022 16:04:48 +0800 Message-Id: <20220301080448.112813-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The smatch tool reported the following warning: drivers/scsi/scsi_error.c:1988 scsi_decide_disposition() warn: ignoring unreachable code. Remove the "default:return FAILED;" instead of "return FAILED;" reported by smatch, because compilers can provide more useful diagnostics about switch/case statements that do not have a default statement, especially if the "switch" applies to a value with enumeration type. Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/scsi/scsi_error.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 9c237b223e63..ee752b4512f8 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1982,8 +1982,6 @@ enum scsi_disposition scsi_decide_disposition(struct scsi_cmnd *scmd) "reservation conflict\n"); set_host_byte(scmd, DID_NEXUS_FAILURE); return SUCCESS; /* causes immediate i/o error */ - default: - return FAILED; } return FAILED; -- 2.20.1.7.g153144c