Skip to content

Commit 5c22e22

Browse files
Joern EngelNicholas Bellinger
authored andcommitted
iscsi-target: simplify return statement
The return statement cannot be reached without either recovery or dump being set to 1. Therefore the condition always evaluates to true and recovery and dump are useless variables. Found by Coverity. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent cb35484 commit 5c22e22

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎drivers/target/iscsi/iscsi_target_erl0.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ static int iscsit_dataout_check_datasn(
345345
struct iscsi_cmd *cmd,
346346
unsigned char *buf)
347347
{
348-
int dump = 0, recovery = 0;
349348
u32 data_sn = 0;
350349
struct iscsi_conn *conn = cmd->conn;
351350
struct iscsi_data *hdr = (struct iscsi_data *) buf;
@@ -370,13 +369,11 @@ static int iscsit_dataout_check_datasn(
370369
pr_err("Command ITT: 0x%08x, received DataSN: 0x%08x"
371370
" higher than expected 0x%08x.\n", cmd->init_task_tag,
372371
be32_to_cpu(hdr->datasn), data_sn);
373-
recovery = 1;
374372
goto recover;
375373
} else if (be32_to_cpu(hdr->datasn) < data_sn) {
376374
pr_err("Command ITT: 0x%08x, received DataSN: 0x%08x"
377375
" lower than expected 0x%08x, discarding payload.\n",
378376
cmd->init_task_tag, be32_to_cpu(hdr->datasn), data_sn);
379-
dump = 1;
380377
goto dump;
381378
}
382379

@@ -392,8 +389,7 @@ static int iscsit_dataout_check_datasn(
392389
if (iscsit_dump_data_payload(conn, payload_length, 1) < 0)
393390
return DATAOUT_CANNOT_RECOVER;
394391

395-
return (recovery || dump) ? DATAOUT_WITHIN_COMMAND_RECOVERY :
396-
DATAOUT_NORMAL;
392+
return DATAOUT_WITHIN_COMMAND_RECOVERY;
397393
}
398394

399395
static int iscsit_dataout_pre_datapduinorder_yes(

0 commit comments

Comments
 (0)