nvme: mark a few more functions static

nvme_qpair_submit_tracker() and nvme_qpair_manual_complete_request() are
only used from within nvme_qpair.c, so they can be static.

nvme_qpair_submit_tracker() is moved up to avoid needing a declaration
(no other code change).

nvme_ctrlr_hw_reset() is only used from within nvme_ctrlr.c, so it can
be static.

Change-Id: I9a7953d7baaec76e875dd535daf557ea24bef801
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-12-22 11:05:24 -07:00
parent 7e069500ad
commit c8f27b9e6e
5 changed files with 21 additions and 41 deletions

View File

@ -254,7 +254,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr)
return nvme_ctrlr_wait_for_ready(ctrlr);
}
int
static int
nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr)
{
uint32_t i;

View File

@ -386,7 +386,6 @@ void nvme_completion_poll_cb(void *arg, const struct nvme_completion *cpl);
int nvme_ctrlr_construct(struct nvme_controller *ctrlr, void *devhandle);
void nvme_ctrlr_destruct(struct nvme_controller *ctrlr);
int nvme_ctrlr_start(struct nvme_controller *ctrlr);
int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr);
void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr,
struct nvme_request *req);
@ -402,17 +401,11 @@ int nvme_qpair_construct(struct nvme_qpair *qpair, uint16_t id,
void nvme_qpair_destroy(struct nvme_qpair *qpair);
void nvme_qpair_enable(struct nvme_qpair *qpair);
void nvme_qpair_disable(struct nvme_qpair *qpair);
void nvme_qpair_submit_tracker(struct nvme_qpair *qpair,
struct nvme_tracker *tr);
void nvme_qpair_process_completions(struct nvme_qpair *qpair, uint32_t max_completions);
void nvme_qpair_submit_request(struct nvme_qpair *qpair,
struct nvme_request *req);
void nvme_qpair_reset(struct nvme_qpair *qpair);
void nvme_qpair_fail(struct nvme_qpair *qpair);
void nvme_qpair_manual_complete_request(struct nvme_qpair *qpair,
struct nvme_request *req,
uint32_t sct, uint32_t sc,
bool print_on_error);
int nvme_ns_construct(struct nvme_namespace *ns, uint16_t id,
struct nvme_controller *ctrlr);

View File

@ -293,6 +293,25 @@ nvme_qpair_construct_tracker(struct nvme_tracker *tr, uint16_t cid, uint64_t phy
tr->cid = cid;
}
static void
nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr)
{
struct nvme_request *req;
req = tr->req;
qpair->act_tr[tr->cid] = tr;
/* Copy the command from the tracker to the submission queue. */
nvme_copy_command(&qpair->cmd[qpair->sq_tail], &req->cmd);
if (++qpair->sq_tail == qpair->num_entries) {
qpair->sq_tail = 0;
}
wmb();
spdk_mmio_write_4(qpair->sq_tdbl, qpair->sq_tail);
}
static void
nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr,
struct nvme_completion *cpl, bool print_on_error)
@ -361,7 +380,7 @@ nvme_qpair_manual_complete_tracker(struct nvme_qpair *qpair,
nvme_qpair_complete_tracker(qpair, tr, &cpl, print_on_error);
}
void
static void
nvme_qpair_manual_complete_request(struct nvme_qpair *qpair,
struct nvme_request *req, uint32_t sct, uint32_t sc,
bool print_on_error)
@ -618,26 +637,6 @@ nvme_qpair_destroy(struct nvme_qpair *qpair)
* nvme_ns_cmd_flush, nvme_get_ioq_idx
*/
void
nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr)
{
struct nvme_request *req;
req = tr->req;
qpair->act_tr[tr->cid] = tr;
/* Copy the command from the tracker to the submission queue. */
nvme_copy_command(&qpair->cmd[qpair->sq_tail], &req->cmd);
if (++qpair->sq_tail == qpair->num_entries) {
qpair->sq_tail = 0;
}
wmb();
spdk_mmio_write_4(qpair->sq_tdbl, qpair->sq_tail);
}
static void
_nvme_fail_request_bad_vtophys(struct nvme_qpair *qpair, struct nvme_tracker *tr)
{

View File

@ -46,12 +46,6 @@ uint64_t nvme_vtophys(void *buf)
return (uintptr_t)buf;
}
int
nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr)
{
return 0;
}
int
nvme_ctrlr_construct(struct nvme_controller *ctrlr, void *devhandle)
{

View File

@ -44,12 +44,6 @@ uint64_t nvme_vtophys(void *buf)
return (uintptr_t)buf;
}
int
nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr)
{
return 0;
}
int
nvme_ctrlr_construct(struct nvme_controller *ctrlr, void *devhandle)
{