diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2021-05-10 12:15:37 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-05-11 18:30:45 +0200 |
commit | 4c2dab2bf5ace0ddc07ca7f04a7ba32fc3b23492 (patch) | |
tree | 3bd0d2ba6b517e60632e5f69b2d2d705f1198027 /drivers/nvme | |
parent | 3651aaacd10b2f8cee3780c490fc2df55bd4f543 (diff) | |
download | linux-4c2dab2bf5ace0ddc07ca7f04a7ba32fc3b23492.tar.bz2 |
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 <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index e7a367cf6d36..dcd49a72f2f3 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -975,10 +975,7 @@ u16 nvmet_parse_admin_cmd(struct nvmet_req *req) case nvme_admin_keep_alive: req->execute = nvmet_execute_keep_alive; return 0; + default: + return nvmet_report_invalid_opcode(req); } - - pr_debug("unhandled cmd %d on qid %d\n", cmd->common.opcode, - req->sq->qid); - req->error_loc = offsetof(struct nvme_common_command, opcode); - return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; } |