scsi: qla4xxx: Remove redundant assignment to variable rval
diff mbox series

Message ID 20201103120137.109717-1-jingxiangfeng@huawei.com
State Accepted
Commit cf4d4d8ebdb838ee996e09e3ee18deb9a7737dea
Headers show
Series
  • scsi: qla4xxx: Remove redundant assignment to variable rval
Related show

Commit Message

Jing Xiangfeng Nov. 3, 2020, 12:01 p.m. UTC
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 <jingxiangfeng@huawei.com>
---
 drivers/scsi/qla4xxx/ql4_os.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Martin K. Petersen Nov. 17, 2020, 5:53 a.m. UTC | #1
Jing,

> The variable rval has been initialized with 'QLA_ERROR'. The
> assignment is redundant in an error path. So remove it.

Applied to 5.11/scsi-staging, thanks!
Martin K. Petersen Nov. 20, 2020, 3:31 a.m. UTC | #2
On Tue, 3 Nov 2020 20:01:37 +0800, Jing Xiangfeng wrote:

> The variable rval has been initialized with 'QLA_ERROR'. The assignment
> is redundant in an error path. So remove it.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: qla4xxx: Remove redundant assignment to variable rval
      https://git.kernel.org/mkp/scsi/c/cf4d4d8ebdb8

Patch
diff mbox series

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;