diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2017-05-07 10:14:44 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-05-07 21:52:45 -0400 |
commit | 629b1b2e0e6c8285fdc21624af60e8190fa4417e (patch) | |
tree | 658726be94c2af5902aa113f679fbf1700f400ca | |
parent | 51d638b1f56a0bfd9219800620994794a1a2b219 (diff) |
lightnvm: remove unused rq parameter of nvme_nvm_rqtocmd() to kill warning
With gcc 4.1.2:
drivers/nvme/host/lightnvm.c: In function ‘nvme_nvm_submit_io’:
drivers/nvme/host/lightnvm.c:498: warning: ‘rq’ is used uninitialized in this function
Indeed, since commit 2e13f33a2464fc3a ("lightnvm: create cmd before
allocating request"), the request is passed to nvme_nvm_rqtocmd() before
it is allocated.
Fortunately, as of commit 91276162de9476b8 ("lightnvm: refactor end_io
functions for sync"), nvme_nvm_rqtocmd () no longer uses the passed
request, so this warning is a false positive.
Drop the unused parameter to clean up the code and kill the warning.
Fixes: 2e13f33a2464fc3a ("lightnvm: create cmd before allocating request")
Fixes: 91276162de9476b8 ("lightnvm: refactor end_io functions for sync")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/nvme/host/lightnvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 8c4adac6fafc..206bfdbc1c98 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c | |||
@@ -464,8 +464,8 @@ static int nvme_nvm_set_bb_tbl(struct nvm_dev *nvmdev, struct ppa_addr *ppas, | |||
464 | return ret; | 464 | return ret; |
465 | } | 465 | } |
466 | 466 | ||
467 | static inline void nvme_nvm_rqtocmd(struct request *rq, struct nvm_rq *rqd, | 467 | static inline void nvme_nvm_rqtocmd(struct nvm_rq *rqd, struct nvme_ns *ns, |
468 | struct nvme_ns *ns, struct nvme_nvm_command *c) | 468 | struct nvme_nvm_command *c) |
469 | { | 469 | { |
470 | c->ph_rw.opcode = rqd->opcode; | 470 | c->ph_rw.opcode = rqd->opcode; |
471 | c->ph_rw.nsid = cpu_to_le32(ns->ns_id); | 471 | c->ph_rw.nsid = cpu_to_le32(ns->ns_id); |
@@ -503,7 +503,7 @@ static int nvme_nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd) | |||
503 | if (!cmd) | 503 | if (!cmd) |
504 | return -ENOMEM; | 504 | return -ENOMEM; |
505 | 505 | ||
506 | nvme_nvm_rqtocmd(rq, rqd, ns, cmd); | 506 | nvme_nvm_rqtocmd(rqd, ns, cmd); |
507 | 507 | ||
508 | rq = nvme_alloc_request(q, (struct nvme_command *)cmd, 0, NVME_QID_ANY); | 508 | rq = nvme_alloc_request(q, (struct nvme_command *)cmd, 0, NVME_QID_ANY); |
509 | if (IS_ERR(rq)) { | 509 | if (IS_ERR(rq)) { |