Whamcloud - gitweb
LU-1889 build: fix false 'uninitialized scalar variable' errs
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index 11ff8e2..8d8143e 100644 (file)
@@ -71,9 +71,8 @@
 #include <liblustre.h>
 #include <lnet/lnetctl.h>
 #include <obd.h>
-#include <lustre_lib.h>
 #include <obd_lov.h>
-#include <lustre/liblustreapi.h>
+#include <lustre/lustreapi.h>
 
 static unsigned llapi_dir_filetype_table[] = {
         [DT_UNKNOWN]= 0,
@@ -2691,9 +2690,15 @@ static int cb_get_mdt_index(char *path, DIR *parent, DIR *d, void *data,
                 return ret;
         }
 
+       /* The 'LASSERT(parent != NULL || d != NULL);' guarantees
+        * that either 'd' or 'parent' is not null.
+        * So in all cases llapi_file_fget_mdtidx() is called,
+        * thus initializing 'mdtidx'. */
         if (param->quiet || !(param->verbose & VERBOSE_DETAIL))
+               /* coverity[uninit_use_in_call] */
                 llapi_printf(LLAPI_MSG_NORMAL, "%d\n", mdtidx);
         else
+               /* coverity[uninit_use_in_call] */
                 llapi_printf(LLAPI_MSG_NORMAL, "%s\nmdt_index:\t%d\n",
                              path, mdtidx);
 
@@ -2859,6 +2864,8 @@ int llapi_ping(char *obd_type, char *obd_name)
                 return rc;
         }
 
+       /* The purpose is to send a byte as a ping, whatever this byte is. */
+       /* coverity[uninit_use_in_call] */
         rc = write(fd, buf, 1);
         if (rc < 0)
                 rc = -errno;