Skip to contentSkip to conversation

scsi: target: remove redundant assignment to variable ret

PATCH Applied Colin King 2 participants 3 messages Jul 21, 2021 – Jul 29, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 scsi: target: remove redundant assignment to variable ret

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read, the assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/target/iscsi/cxgbit/cxgbit_ddp.c | 2 +-
 drivers/target/loopback/tcm_loop.c       | 4 ++--
 drivers/target/target_core_iblock.c      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/target/iscsi/cxgbit/cxgbit_ddp.c +1 -1
index b044999ad002..072afd070f3e 100644
@@ -234,7 +234,7 @@ cxgbit_get_r2t_ttt(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
 	struct cxgbit_device *cdev = csk->com.cdev;
 	struct cxgbit_cmd *ccmd = iscsit_priv_cmd(cmd);
 	struct cxgbi_task_tag_info *ttinfo = &ccmd->ttinfo;
-	int ret = -EINVAL;
+	int ret;
 
 	if ((!ccmd->setup_ddp) ||
 	    (!test_bit(CSK_DDP_ENABLE, &csk->com.flags)))
drivers/target/loopback/tcm_loop.c +2 -2
index 6d0b0e67e79e..fdc36274cb39 100644
@@ -241,7 +241,7 @@ static int tcm_loop_abort_task(struct scsi_cmnd *sc)
 {
 	struct tcm_loop_hba *tl_hba;
 	struct tcm_loop_tpg *tl_tpg;
-	int ret = FAILED;
+	int ret;
 
 	/*
 	 * Locate the tcm_loop_hba_t pointer
@@ -261,7 +261,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
 {
 	struct tcm_loop_hba *tl_hba;
 	struct tcm_loop_tpg *tl_tpg;
-	int ret = FAILED;
+	int ret;
 
 	/*
 	 * Locate the tcm_loop_hba_t pointer
drivers/target/target_core_iblock.c +1 -1
index 44d9d028f716..4069a1edcfa3 100644
@@ -83,7 +83,7 @@ static int iblock_configure_device(struct se_device *dev)
 	struct blk_integrity *bi;
 	fmode_t mode;
 	unsigned int max_write_zeroes_sectors;
-	int ret = -ENOMEM;
+	int ret;
 
 	if (!(ib_dev->ibd_flags & IBDF_HAS_UDEV_PATH)) {
 		pr_err("Missing udev_path= parameters for IBLOCK\n");
Signature · 1 line
2.31.1
#1 lore raw

Colin,

Quoted 2 lines

The variable ret is being initialized with a value that is never read, the assignment is redundant and can be removed.

Applied to 5.15/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering