From: Bart Van Assche Date: Tue, 18 Jun 2019 18:12:19 +0000 (-0700) Subject: Use NULL instead of 0 where a pointer is expected X-Git-Tag: v1.9~40^2~11 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b4fd0946acfd43e5ca4b0d5acf8dd322eeafc570;p=users%2Fsagi%2Fnvme-cli.git Use NULL instead of 0 where a pointer is expected This patch avoids that sparse reports the following: warning: Using plain integer as NULL pointer Cc: Muhammad Ahmad Cc: Quyen Truong Signed-off-by: Bart Van Assche --- diff --git a/plugins/seagate/seagate-nvme.c b/plugins/seagate/seagate-nvme.c index 4b5b0acb..69f3667d 100644 --- a/plugins/seagate/seagate-nvme.c +++ b/plugins/seagate/seagate-nvme.c @@ -173,7 +173,7 @@ static int log_pages_supp(int argc, char **argv, struct command *cmd, const struct argconfig_commandline_options command_line_options[] = { {"output-format", 'o', "FMT", CFG_STRING, &cfg.output_format, required_argument, output_format }, - {0} + { } }; fd = parse_and_open(argc, argv, desc, command_line_options, @@ -735,7 +735,7 @@ static int vs_smart_log(int argc, char **argv, struct command *cmd, struct plugi const struct argconfig_commandline_options command_line_options[] = { {"output-format", 'o', "FMT", CFG_STRING, &cfg.output_format, required_argument, output_format }, - {0} + { } }; fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg)); @@ -832,7 +832,7 @@ static int temp_stats(int argc, char **argv, struct command *cmd, struct plugin const struct argconfig_commandline_options command_line_options[] = { {"output-format", 'o', "FMT", CFG_STRING, &cfg.output_format, required_argument, output_format }, - {0} + { } }; fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg)); @@ -1004,7 +1004,7 @@ static int vs_pcie_error_log(int argc, char **argv, struct command *cmd, struct const struct argconfig_commandline_options command_line_options[] = { {"output-format", 'o', "FMT", CFG_STRING, &cfg.output_format, required_argument, output_format }, - {0} + { } }; fd = parse_and_open(argc, argv, desc, command_line_options, &cfg, sizeof(cfg)); diff --git a/plugins/virtium/virtium-nvme.c b/plugins/virtium/virtium-nvme.c index b5b30af5..ca5f5774 100644 --- a/plugins/virtium/virtium-nvme.c +++ b/plugins/virtium/virtium-nvme.c @@ -287,7 +287,7 @@ static int vt_add_entry_to_log(const int fd, const char *path, const struct vtvi strcpy(filename, cfg->output_file); } - smart.time_stamp = time(0); + smart.time_stamp = time(NULL); nsid = nvme_get_nsid(fd); if(nsid <= 0) @@ -353,7 +353,7 @@ static int vt_update_vtview_log_header(const int fd, const char *path, const str } printf("Log file: %s\n", filename); - header.time_stamp = time(0); + header.time_stamp = time(NULL); ret = nvme_identify_ctrl(fd, &header.raw_ctrl); if(ret) @@ -881,14 +881,14 @@ Just logging :\n\ freq_time = 1; } - start_time = time(0); + start_time = time(NULL); end_time = start_time + total_time; fflush(stdout); while(1) { - cur_time = time(0); + cur_time = time(NULL); if(cur_time >= end_time) { break;