build: enable missing function declaration warning

This helps weed out functions that should be static, functions that are
not declared in public header files, and .c files that don't include
their .h interface headers.

Change-Id: Ie39f83ad4b320847e4a938bd1d4d0b4fa21c2ffa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-11-02 13:44:47 -07:00
parent e9fa656027
commit 8307eb5f55
9 changed files with 47 additions and 53 deletions

View File

@ -291,7 +291,7 @@ aio_check_io(struct ns_entry *entry)
} }
#endif /* HAVE_LIBAIO */ #endif /* HAVE_LIBAIO */
void task_ctor(struct rte_mempool *mp, void *arg, void *__task, unsigned id) static void task_ctor(struct rte_mempool *mp, void *arg, void *__task, unsigned id)
{ {
struct perf_task *task = __task; struct perf_task *task = __task;
task->buf = rte_malloc(NULL, g_io_size_bytes, 0x200); task->buf = rte_malloc(NULL, g_io_size_bytes, 0x200);

View File

@ -127,7 +127,7 @@ vtophys_get_map(uint64_t vfn_2mb)
return map_2mb; return map_2mb;
} }
uint64_t static uint64_t
vtophys_get_pfn_2mb(uint64_t vfn_2mb) vtophys_get_pfn_2mb(uint64_t vfn_2mb)
{ {
uintptr_t vaddr, paddr; uintptr_t vaddr, paddr;

View File

@ -31,6 +31,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "spdk/file.h"
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -43,7 +43,7 @@ endif
OS := $(shell uname) OS := $(shell uname)
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wmissing-declarations -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include
COMMON_CFLAGS += -Wformat -Wformat-security -Wformat-nonliteral COMMON_CFLAGS += -Wformat -Wformat-security -Wformat-nonliteral

View File

@ -69,7 +69,7 @@ nvme_ctrlr_start(struct nvme_controller *ctrlr)
return 0; return 0;
} }
void prepare_for_test(uint32_t max_io_queues) static void prepare_for_test(uint32_t max_io_queues)
{ {
struct nvme_driver *driver = &g_nvme_driver; struct nvme_driver *driver = &g_nvme_driver;
@ -86,7 +86,7 @@ void prepare_for_test(uint32_t max_io_queues)
threads_fail = 0; threads_fail = 0;
} }
void * static void *
nvme_thread(void *arg) nvme_thread(void *arg)
{ {
int rc; int rc;
@ -108,7 +108,7 @@ nvme_thread(void *arg)
pthread_exit(NULL); pthread_exit(NULL);
} }
void static void
test1(void) test1(void)
{ {
struct nvme_driver *driver = &g_nvme_driver; struct nvme_driver *driver = &g_nvme_driver;
@ -136,7 +136,7 @@ test1(void)
CU_ASSERT(driver->ioq_index_pool_next == 0); CU_ASSERT(driver->ioq_index_pool_next == 0);
} }
void static void
test2(void) test2(void)
{ {
int num_threads = 16; int num_threads = 16;

View File

@ -163,7 +163,7 @@ nvme_allocate_request(void *payload, uint32_t payload_size,
return req; return req;
} }
void static void
test_nvme_ctrlr_fail(void) test_nvme_ctrlr_fail(void)
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};

View File

@ -55,7 +55,7 @@ uint16_t abort_sqid = 1;
typedef void (*verify_request_fn_t)(struct nvme_request *req); typedef void (*verify_request_fn_t)(struct nvme_request *req);
verify_request_fn_t verify_fn; verify_request_fn_t verify_fn;
void verify_firmware_log_page(struct nvme_request *req) static void verify_firmware_log_page(struct nvme_request *req)
{ {
uint32_t temp_cdw10; uint32_t temp_cdw10;
@ -67,7 +67,7 @@ void verify_firmware_log_page(struct nvme_request *req)
CU_ASSERT(req->cmd.cdw10 == temp_cdw10); CU_ASSERT(req->cmd.cdw10 == temp_cdw10);
} }
void verify_health_log_page(struct nvme_request *req) static void verify_health_log_page(struct nvme_request *req)
{ {
uint32_t temp_cdw10; uint32_t temp_cdw10;
@ -79,7 +79,7 @@ void verify_health_log_page(struct nvme_request *req)
CU_ASSERT(req->cmd.cdw10 == temp_cdw10); CU_ASSERT(req->cmd.cdw10 == temp_cdw10);
} }
void verify_error_log_page(struct nvme_request *req) static void verify_error_log_page(struct nvme_request *req)
{ {
uint32_t temp_cdw10; uint32_t temp_cdw10;
@ -91,27 +91,27 @@ void verify_error_log_page(struct nvme_request *req)
CU_ASSERT(req->cmd.cdw10 == temp_cdw10); CU_ASSERT(req->cmd.cdw10 == temp_cdw10);
} }
void verify_set_feature_cmd(struct nvme_request *req) static void verify_set_feature_cmd(struct nvme_request *req)
{ {
CU_ASSERT(req->cmd.opc == NVME_OPC_SET_FEATURES); CU_ASSERT(req->cmd.opc == NVME_OPC_SET_FEATURES);
CU_ASSERT(req->cmd.cdw10 == feature); CU_ASSERT(req->cmd.cdw10 == feature);
CU_ASSERT(req->cmd.cdw11 == feature_cdw11); CU_ASSERT(req->cmd.cdw11 == feature_cdw11);
} }
void verify_get_feature_cmd(struct nvme_request *req) static void verify_get_feature_cmd(struct nvme_request *req)
{ {
CU_ASSERT(req->cmd.opc == NVME_OPC_GET_FEATURES); CU_ASSERT(req->cmd.opc == NVME_OPC_GET_FEATURES);
CU_ASSERT(req->cmd.cdw10 == get_feature); CU_ASSERT(req->cmd.cdw10 == get_feature);
CU_ASSERT(req->cmd.cdw11 == get_feature_cdw11); CU_ASSERT(req->cmd.cdw11 == get_feature_cdw11);
} }
void verify_abort_cmd(struct nvme_request *req) static void verify_abort_cmd(struct nvme_request *req)
{ {
CU_ASSERT(req->cmd.opc == NVME_OPC_ABORT); CU_ASSERT(req->cmd.opc == NVME_OPC_ABORT);
CU_ASSERT(req->cmd.cdw10 == (((uint32_t)abort_cid << 16) | abort_sqid)); CU_ASSERT(req->cmd.cdw10 == (((uint32_t)abort_cid << 16) | abort_sqid));
} }
void verify_io_raw_cmd(struct nvme_request *req) static void verify_io_raw_cmd(struct nvme_request *req)
{ {
struct nvme_command command = {}; struct nvme_command command = {};
@ -159,7 +159,7 @@ nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr, struct nvme_reque
} }
void static void
test_firmware_get_log_page() test_firmware_get_log_page()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -170,7 +170,7 @@ test_firmware_get_log_page()
nvme_ctrlr_cmd_get_firmware_page(&ctrlr, &payload, NULL, NULL); nvme_ctrlr_cmd_get_firmware_page(&ctrlr, &payload, NULL, NULL);
} }
void static void
test_health_get_log_page() test_health_get_log_page()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -181,7 +181,7 @@ test_health_get_log_page()
nvme_ctrlr_cmd_get_health_information_page(&ctrlr, health_log_nsid, &payload, NULL, NULL); nvme_ctrlr_cmd_get_health_information_page(&ctrlr, health_log_nsid, &payload, NULL, NULL);
} }
void static void
test_error_get_log_page() test_error_get_log_page()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -196,7 +196,7 @@ test_error_get_log_page()
nvme_ctrlr_cmd_get_error_page(&ctrlr, &payload, error_num_entries, NULL, NULL); nvme_ctrlr_cmd_get_error_page(&ctrlr, &payload, error_num_entries, NULL, NULL);
} }
void static void
test_set_feature_cmd() test_set_feature_cmd()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -207,7 +207,7 @@ test_set_feature_cmd()
} }
void static void
test_get_feature_cmd() test_get_feature_cmd()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -217,7 +217,7 @@ test_get_feature_cmd()
nvme_ctrlr_cmd_get_feature(&ctrlr, get_feature, get_feature_cdw11, NULL, 0, NULL, NULL); nvme_ctrlr_cmd_get_feature(&ctrlr, get_feature, get_feature_cdw11, NULL, 0, NULL, NULL);
} }
void static void
test_abort_cmd() test_abort_cmd()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -227,7 +227,7 @@ test_abort_cmd()
nvme_ctrlr_cmd_abort(&ctrlr, abort_cid, abort_sqid, NULL, NULL); nvme_ctrlr_cmd_abort(&ctrlr, abort_cid, abort_sqid, NULL, NULL);
} }
void static void
test_io_raw_cmd() test_io_raw_cmd()
{ {
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};

View File

@ -86,7 +86,7 @@ nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr,
g_request = req; g_request = req;
} }
void static void
prepare_for_test(struct nvme_namespace *ns, struct nvme_controller *ctrlr, prepare_for_test(struct nvme_namespace *ns, struct nvme_controller *ctrlr,
uint32_t sector_size, uint32_t max_xfer_size, uint32_t sector_size, uint32_t max_xfer_size,
uint32_t stripe_size) uint32_t stripe_size)
@ -102,7 +102,7 @@ prepare_for_test(struct nvme_namespace *ns, struct nvme_controller *ctrlr,
g_request = NULL; g_request = NULL;
} }
void static void
nvme_cmd_interpret_rw(const struct nvme_command *cmd, nvme_cmd_interpret_rw(const struct nvme_command *cmd,
uint64_t *lba, uint32_t *num_blocks) uint64_t *lba, uint32_t *num_blocks)
{ {
@ -110,7 +110,7 @@ nvme_cmd_interpret_rw(const struct nvme_command *cmd,
*num_blocks = (cmd->cdw12 & 0xFFFFu) + 1; *num_blocks = (cmd->cdw12 & 0xFFFFu) + 1;
} }
void static void
split_test(void) split_test(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;
@ -139,7 +139,7 @@ split_test(void)
nvme_free_request(g_request); nvme_free_request(g_request);
} }
void static void
split_test2(void) split_test2(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;
@ -192,7 +192,7 @@ split_test2(void)
nvme_free_request(g_request); nvme_free_request(g_request);
} }
void static void
split_test3(void) split_test3(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;
@ -247,7 +247,7 @@ split_test3(void)
nvme_free_request(g_request); nvme_free_request(g_request);
} }
void static void
split_test4(void) split_test4(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;
@ -313,7 +313,7 @@ split_test4(void)
nvme_free_request(g_request); nvme_free_request(g_request);
} }
void static void
test_nvme_ns_cmd_flush(void) test_nvme_ns_cmd_flush(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;
@ -330,7 +330,7 @@ test_nvme_ns_cmd_flush(void)
nvme_free_request(g_request); nvme_free_request(g_request);
} }
void static void
test_nvme_ns_cmd_deallocate(void) test_nvme_ns_cmd_deallocate(void)
{ {
struct nvme_namespace ns; struct nvme_namespace ns;

View File

@ -55,14 +55,6 @@ uint64_t nvme_vtophys(void *buf)
} }
} }
void nvme_dump_completion(struct nvme_completion *cpl)
{
}
void prepare_for_test(void)
{
}
struct nvme_request * struct nvme_request *
nvme_allocate_request(void *payload, uint32_t payload_size, nvme_allocate_request(void *payload, uint32_t payload_size,
nvme_cb_fn_t cb_fn, void *cb_arg) nvme_cb_fn_t cb_fn, void *cb_arg)
@ -107,7 +99,7 @@ nvme_free_request(struct nvme_request *req)
nvme_dealloc_request(req); nvme_dealloc_request(req);
} }
void static void
test1(void) test1(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
@ -128,7 +120,7 @@ test1(void)
CU_ASSERT(strstr(outbuf, "IDENTIFY") != NULL); CU_ASSERT(strstr(outbuf, "IDENTIFY") != NULL);
} }
void static void
test2(void) test2(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
@ -149,7 +141,7 @@ test2(void)
CU_ASSERT(strstr(outbuf, "DATASET MANAGEMENT") != NULL); CU_ASSERT(strstr(outbuf, "DATASET MANAGEMENT") != NULL);
} }
void static void
prepare_submit_request_test(struct nvme_qpair *qpair, prepare_submit_request_test(struct nvme_qpair *qpair,
struct nvme_controller *ctrlr, struct nvme_controller *ctrlr,
struct nvme_registers *regs) struct nvme_registers *regs)
@ -164,25 +156,25 @@ prepare_submit_request_test(struct nvme_qpair *qpair,
fail_vtophys = false; fail_vtophys = false;
} }
void static void
cleanup_submit_request_test(struct nvme_qpair *qpair) cleanup_submit_request_test(struct nvme_qpair *qpair)
{ {
nvme_qpair_destroy(qpair); nvme_qpair_destroy(qpair);
} }
void static void
expected_success_callback(void *arg, const struct nvme_completion *cpl) expected_success_callback(void *arg, const struct nvme_completion *cpl)
{ {
CU_ASSERT(!nvme_completion_is_error(cpl)); CU_ASSERT(!nvme_completion_is_error(cpl));
} }
void static void
expected_failure_callback(void *arg, const struct nvme_completion *cpl) expected_failure_callback(void *arg, const struct nvme_completion *cpl)
{ {
CU_ASSERT(nvme_completion_is_error(cpl)); CU_ASSERT(nvme_completion_is_error(cpl));
} }
void static void
test3(void) test3(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
@ -205,7 +197,7 @@ test3(void)
nvme_free_request(req); nvme_free_request(req);
} }
void static void
test4(void) test4(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
@ -238,7 +230,7 @@ test4(void)
cleanup_submit_request_test(&qpair); cleanup_submit_request_test(&qpair);
} }
void static void
test_ctrlr_failed(void) test_ctrlr_failed(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
@ -272,7 +264,7 @@ test_ctrlr_failed(void)
cleanup_submit_request_test(&qpair); cleanup_submit_request_test(&qpair);
} }
void struct_packing(void) static void struct_packing(void)
{ {
/* ctrlr is the first field in nvme_qpair after the fields /* ctrlr is the first field in nvme_qpair after the fields
* that are used in the I/O path. Make sure the I/O path fields * that are used in the I/O path. Make sure the I/O path fields
@ -281,7 +273,7 @@ void struct_packing(void)
CU_ASSERT(offsetof(struct nvme_qpair, ctrlr) <= 128); CU_ASSERT(offsetof(struct nvme_qpair, ctrlr) <= 128);
} }
void test_nvme_qpair_fail(void) static void test_nvme_qpair_fail(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
struct nvme_request *req = NULL; struct nvme_request *req = NULL;
@ -311,7 +303,7 @@ void test_nvme_qpair_fail(void)
cleanup_submit_request_test(&qpair); cleanup_submit_request_test(&qpair);
} }
void test_nvme_qpair_process_completions(void) static void test_nvme_qpair_process_completions(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -325,7 +317,7 @@ void test_nvme_qpair_process_completions(void)
cleanup_submit_request_test(&qpair); cleanup_submit_request_test(&qpair);
} }
void test_nvme_qpair_destroy(void) static void test_nvme_qpair_destroy(void)
{ {
struct nvme_qpair qpair = {}; struct nvme_qpair qpair = {};
struct nvme_controller ctrlr = {}; struct nvme_controller ctrlr = {};
@ -346,7 +338,7 @@ void test_nvme_qpair_destroy(void)
nvme_qpair_destroy(&qpair); nvme_qpair_destroy(&qpair);
} }
void test_nvme_completion_is_retry(void) static void test_nvme_completion_is_retry(void)
{ {
struct nvme_completion cpl = {}; struct nvme_completion cpl = {};
@ -407,7 +399,7 @@ void test_nvme_completion_is_retry(void)
CU_ASSERT_FALSE(nvme_completion_is_retry(&cpl)); CU_ASSERT_FALSE(nvme_completion_is_retry(&cpl));
} }
void static void
test_get_status_string(void) test_get_status_string(void)
{ {
const char *status_string; const char *status_string;