build: enable missing field initializer warning

Replace {0} initializers with {}, since it is equivalent and simpler
(and avoids the warning).

Change-Id: Id2014a352e2c627598cd3b4f1ca04dba35f2dc3a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-11-02 13:22:02 -07:00
parent a945f60c79
commit fd93c1b1ef
4 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ get_log_page_completion(void *cb_arg, const struct nvme_completion *cpl)
static int
get_feature(struct nvme_controller *ctrlr, uint8_t fid)
{
struct nvme_command cmd = {0};
struct nvme_command cmd = {};
cmd.opc = NVME_OPC_GET_FEATURES;
cmd.cdw10 = fid;
@ -120,7 +120,7 @@ get_features(struct nvme_controller *ctrlr)
static int
get_health_log_page(struct nvme_controller *ctrlr)
{
struct nvme_command cmd = {0};
struct nvme_command cmd = {};
if (health_page == NULL) {
health_page = rte_zmalloc("nvme health", sizeof(*health_page), 4096);

View File

@ -43,7 +43,7 @@ endif
OS := $(shell uname)
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wsign-compare -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wsign-compare -Wmissing-field-initializers -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include
COMMON_CFLAGS += -Wformat -Wformat-security -Wformat-nonliteral

View File

@ -77,7 +77,7 @@ static void set_feature_completion(void *arg, const struct nvme_completion *cpl)
static int
set_temp_threshold(struct dev *dev, uint32_t temp)
{
struct nvme_command cmd = {0};
struct nvme_command cmd = {};
cmd.opc = NVME_OPC_SET_FEATURES;
cmd.cdw10 = NVME_FEAT_TEMPERATURE_THRESHOLD;
@ -106,7 +106,7 @@ get_feature_completion(void *cb_arg, const struct nvme_completion *cpl)
static int
get_temp_threshold(struct dev *dev)
{
struct nvme_command cmd = {0};
struct nvme_command cmd = {};
cmd.opc = NVME_OPC_GET_FEATURES;
cmd.cdw10 = NVME_FEAT_TEMPERATURE_THRESHOLD;
@ -138,7 +138,7 @@ get_log_page_completion(void *cb_arg, const struct nvme_completion *cpl)
static int
get_health_log_page(struct dev *dev)
{
struct nvme_command cmd = {0};
struct nvme_command cmd = {};
cmd.opc = NVME_OPC_GET_LOG_PAGE;
cmd.cdw10 = NVME_LOG_HEALTH_INFORMATION;

View File

@ -113,7 +113,7 @@ void verify_abort_cmd(struct nvme_request *req)
void verify_io_raw_cmd(struct nvme_request *req)
{
struct nvme_command command = {0};
struct nvme_command command = {};
CU_ASSERT(memcmp(&req->cmd, &command, sizeof(req->cmd)) == 0);
}