Skip to content

Commit 4c2dab2

Browse files
ChaitanayaKulkarniChristoph Hellwig
authored andcommitted
nvmet: use helper to remove the duplicate code
Use the helper nvmet_report_invalid_opcode() to report invalid opcode so we can remove the duplicate code. Signed-off-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 3651aaa commit 4c2dab2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/nvme/target/admin-cmd.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,7 @@ u16 nvmet_parse_admin_cmd(struct nvmet_req *req)
975975
case nvme_admin_keep_alive:
976976
req->execute = nvmet_execute_keep_alive;
977977
return 0;
978+
default:
979+
return nvmet_report_invalid_opcode(req);
978980
}
979-
980-
pr_debug("unhandled cmd %d on qid %d\n", cmd->common.opcode,
981-
req->sq->qid);
982-
req->error_loc = offsetof(struct nvme_common_command, opcode);
983-
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
984981
}

0 commit comments

Comments
 (0)