From patchwork Tue Nov 3 12:01:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Xiangfeng X-Patchwork-Id: 11877275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F46B92C for ; Tue, 3 Nov 2020 11:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3727122403 for ; Tue, 3 Nov 2020 11:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbgKCL4f (ORCPT ); Tue, 3 Nov 2020 06:56:35 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6696 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbgKCL4f (ORCPT ); Tue, 3 Nov 2020 06:56:35 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CQStR0xXvz15QX0; Tue, 3 Nov 2020 19:56:31 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Nov 2020 19:56:26 +0800 From: Jing Xiangfeng To: , CC: , , Subject: [PATCH] scsi: qla4xxx: Remove redundant assignment to variable rval Date: Tue, 3 Nov 2020 20:01:37 +0800 Message-ID: <20201103120137.109717-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The variable rval has been initialized with 'QLA_ERROR'. The assignment is redundant in an error path. So remove it. Signed-off-by: Jing Xiangfeng --- drivers/scsi/qla4xxx/ql4_os.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 676778cbc550..aaccbf71dff5 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -686,7 +686,6 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha, if (!ha->chap_list) { ql4_printk(KERN_ERR, ha, "CHAP table cache is empty!\n"); - rval = QLA_ERROR; goto exit_get_chap; } @@ -698,14 +697,12 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha, if (chap_index > max_chap_entries) { ql4_printk(KERN_ERR, ha, "Invalid Chap index\n"); - rval = QLA_ERROR; goto exit_get_chap; } *chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index; if ((*chap_entry)->cookie != __constant_cpu_to_le16(CHAP_VALID_COOKIE)) { - rval = QLA_ERROR; *chap_entry = NULL; } else { rval = QLA_SUCCESS;