]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Use NULL instead of 0 where a pointer is expected
authorBart Van Assche <bvanassche@acm.org>
Tue, 18 Jun 2019 18:12:19 +0000 (11:12 -0700)
committerBart Van Assche <bvanassche@acm.org>
Wed, 19 Jun 2019 16:17:14 +0000 (09:17 -0700)
This patch avoids that sparse reports the following:

warning: Using plain integer as NULL pointer

Cc: Muhammad Ahmad <muhammad.ahmad@seagate.com>
Cc: Quyen Truong <quyen.truong@virtium.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
plugins/seagate/seagate-nvme.c
plugins/virtium/virtium-nvme.c

index 4b5b0acb92447ef94c5675609121fb6ee144e553..69f3667d5b163d218de6998a72b63043bea20972 100644 (file)
@@ -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));
index b5b30af5dacdc807e33b141fe21c114b1434a44b..ca5f5774af8cdc31d0f61e5a07c88be86593e3f4 100644 (file)
@@ -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;