Whamcloud - gitweb
LU-3107 build: fix 'code maintainability' errors
authorSebastien Buisson <sebastien.buisson@bull.net>
Thu, 4 Apr 2013 14:14:35 +0000 (16:14 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 11 Jun 2013 16:01:02 +0000 (12:01 -0400)
Fix 'code maintainability' issues found by Coverity version 6.5.1:
Unused pointer value (UNUSED_VALUE)
Pointer returned by function is never used.
Missing varargs init or cleanup (VARARGS)
va_end was not called for variable.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I5dd51c4332e966a5e4b274ff5c699a571931161c
Reviewed-on: http://review.whamcloud.com/5944
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/mdt/mdt_handler.c
lustre/obdclass/lprocfs_jobstats.c
lustre/osd-ldiskfs/osd_iam.c
lustre/ptlrpc/pack_generic.c
lustre/quota/qsd_entry.c

index 0b4359d..fa8ef5a 100644 (file)
@@ -4169,7 +4169,7 @@ static int mdt_fld_init(const struct lu_env *env,
 static void mdt_stack_pre_fini(const struct lu_env *env,
                           struct mdt_device *m, struct lu_device *top)
 {
 static void mdt_stack_pre_fini(const struct lu_env *env,
                           struct mdt_device *m, struct lu_device *top)
 {
-       struct obd_device       *obd = mdt2obd_dev(m);
+       struct obd_device       *obd;
        struct lustre_cfg_bufs  *bufs;
        struct lustre_cfg       *lcfg;
        struct mdt_thread_info  *info;
        struct lustre_cfg_bufs  *bufs;
        struct lustre_cfg       *lcfg;
        struct mdt_thread_info  *info;
index e6eb738..ec955a2 100644 (file)
@@ -369,7 +369,6 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v)
        struct job_stat                 *job = v;
        struct lprocfs_stats            *s;
        struct lprocfs_counter          ret;
        struct job_stat                 *job = v;
        struct lprocfs_stats            *s;
        struct lprocfs_counter          ret;
-       struct lprocfs_counter          *cntr;
        struct lprocfs_counter_header   *cntr_header;
        int                             i;
 
        struct lprocfs_counter_header   *cntr_header;
        int                             i;
 
@@ -383,7 +382,6 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v)
 
        s = job->js_stats;
        for (i = 0; i < s->ls_num; i++) {
 
        s = job->js_stats;
        for (i = 0; i < s->ls_num; i++) {
-               cntr = lprocfs_stats_counter_get(s, 0, i);
                cntr_header = &s->ls_cnt_header[i];
                lprocfs_stats_collect(s, i, &ret);
 
                cntr_header = &s->ls_cnt_header[i];
                lprocfs_stats_collect(s, i, &ret);
 
index 0c3000b..b6e16a7 100644 (file)
@@ -1040,9 +1040,7 @@ int iam_lookup_lock(struct iam_path *path,
                    struct dynlock_handle **dl, enum dynlock_type lt)
 {
         int result;
                    struct dynlock_handle **dl, enum dynlock_type lt)
 {
         int result;
-        struct inode *dir;
 
 
-        dir = iam_path_obj(path);
         while ((result = __iam_path_lookup(path)) == 0) {
                 do_corr(schedule());
                *dl = iam_lock_htree(path->ip_container, path->ip_frame->leaf,
         while ((result = __iam_path_lookup(path)) == 0) {
                 do_corr(schedule());
                *dl = iam_lock_htree(path->ip_container, path->ip_frame->leaf,
@@ -1072,13 +1070,11 @@ int iam_lookup_lock(struct iam_path *path,
 static int iam_path_lookup(struct iam_path *path, int index)
 {
         struct iam_container *c;
 static int iam_path_lookup(struct iam_path *path, int index)
 {
         struct iam_container *c;
-        struct iam_descr *descr;
         struct iam_leaf  *leaf;
         int result;
 
         c = path->ip_container;
         leaf = &path->ip_leaf;
         struct iam_leaf  *leaf;
         int result;
 
         c = path->ip_container;
         leaf = &path->ip_leaf;
-        descr = iam_path_descr(path);
         result = iam_lookup_lock(path, &leaf->il_lock, DLT_WRITE);
         assert_inv(iam_path_check(path));
         do_corr(schedule());
         result = iam_lookup_lock(path, &leaf->il_lock, DLT_WRITE);
         assert_inv(iam_path_check(path));
         do_corr(schedule());
@@ -1500,7 +1496,6 @@ int iam_it_next(struct iam_iterator *it)
         int result;
         struct iam_path      *path;
         struct iam_leaf      *leaf;
         int result;
         struct iam_path      *path;
         struct iam_leaf      *leaf;
-        struct inode         *obj;
         do_corr(struct iam_ikey *ik_orig);
 
         /* assert_corr(it->ii_flags&IAM_IT_MOVE); */
         do_corr(struct iam_ikey *ik_orig);
 
         /* assert_corr(it->ii_flags&IAM_IT_MOVE); */
@@ -1509,7 +1504,6 @@ int iam_it_next(struct iam_iterator *it)
 
         path = &it->ii_path;
         leaf = &path->ip_leaf;
 
         path = &it->ii_path;
         leaf = &path->ip_leaf;
-        obj  = iam_path_obj(path);
 
         assert_corr(iam_leaf_is_locked(leaf));
 
 
         assert_corr(iam_leaf_is_locked(leaf));
 
index 5da443c..a8b14ae 100644 (file)
@@ -2465,6 +2465,7 @@ void _debug_req(struct ptlrpc_request *req,
                            rep_ok ? lustre_msg_get_flags(req->rq_repmsg) : -1,
                            req->rq_status,
                            rep_ok ? lustre_msg_get_status(req->rq_repmsg) : -1);
                            rep_ok ? lustre_msg_get_flags(req->rq_repmsg) : -1,
                            req->rq_status,
                            rep_ok ? lustre_msg_get_status(req->rq_repmsg) : -1);
+       va_end(args);
 }
 EXPORT_SYMBOL(_debug_req);
 
 }
 EXPORT_SYMBOL(_debug_req);
 
index 759bb3a..8668201 100644 (file)
@@ -313,14 +313,11 @@ out:
 int qsd_update_lqe(const struct lu_env *env, struct lquota_entry *lqe,
                   bool global, void *rec)
 {
 int qsd_update_lqe(const struct lu_env *env, struct lquota_entry *lqe,
                   bool global, void *rec)
 {
-       struct qsd_qtype_info *qqi;
        ENTRY;
 
        LASSERT(lqe != NULL);
        LASSERT(!lqe_is_master(lqe));
 
        ENTRY;
 
        LASSERT(lqe != NULL);
        LASSERT(!lqe_is_master(lqe));
 
-       qqi = lqe2qqi(lqe);
-
        /* updating lqe is always serialized, no locking needed. */
        if (global) {
                struct lquota_glb_rec *glb_rec = (struct lquota_glb_rec *)rec;
        /* updating lqe is always serialized, no locking needed. */
        if (global) {
                struct lquota_glb_rec *glb_rec = (struct lquota_glb_rec *)rec;