Commit 5698b805 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Christoph Hellwig

nvmet: use a macro for default error location

This patch defines a new macro NVMET_NO_ERROR_LOC to represent the
default error location value in the nvme-error-log-page.
This is a pure cleanup patch and it does not change any functionality.
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 66c6afbd
...@@ -663,7 +663,7 @@ static void nvmet_set_error(struct nvmet_req *req, u16 status) ...@@ -663,7 +663,7 @@ static void nvmet_set_error(struct nvmet_req *req, u16 status)
req->rsp->status = cpu_to_le16(status << 1); req->rsp->status = cpu_to_le16(status << 1);
if (!ctrl || req->error_loc == (u16)-1) if (!ctrl || req->error_loc == NVMET_NO_ERROR_LOC)
return; return;
spin_lock_irqsave(&ctrl->error_lock, flags); spin_lock_irqsave(&ctrl->error_lock, flags);
...@@ -849,7 +849,7 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq, ...@@ -849,7 +849,7 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
req->rsp->status = 0; req->rsp->status = 0;
req->rsp->sq_head = 0; req->rsp->sq_head = 0;
req->ns = NULL; req->ns = NULL;
req->error_loc = -1; req->error_loc = NVMET_NO_ERROR_LOC;
req->error_slba = 0; req->error_slba = 0;
/* no support for fused commands yet */ /* no support for fused commands yet */
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define NVMET_ASYNC_EVENTS 4 #define NVMET_ASYNC_EVENTS 4
#define NVMET_ERROR_LOG_SLOTS 128 #define NVMET_ERROR_LOG_SLOTS 128
#define NVMET_NO_ERROR_LOC ((u16)-1)
/* /*
* Supported optional AENs: * Supported optional AENs:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment