From: Sebastien Buisson Date: Mon, 27 May 2013 15:05:28 +0000 (+0200) Subject: LU-3404 build: fix 'incorrect expression' errors X-Git-Tag: 2.4.52~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F6465%2F2;p=fs%2Flustre-release.git LU-3404 build: fix 'incorrect expression' errors Fix 'program hangs' defects found by Coverity version 6.5.1: Array compared against 0 (NO_EFFECT) Comparing an array to null is not useful. Copy-paste error (COPY_PASTE_ERROR) This line looks like a copy-paste error. Self assignment (NO_EFFECT) Assignment operation has no effect. Side effect in assertion (ASSERT_SIDE_EFFECT) Assignment has a side effect. This code will work differently in a non-debug build. You might have intended to use a comparison instead. Wrong sizeof argument (SIZEOF_MISMATCH) Passing argument is suspicious. Signed-off-by: Sebastien Buisson Change-Id: Iad370305cb8540f7c1b918e53ceae32e9ccbba8f Reviewed-on: http://review.whamcloud.com/6465 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- diff --git a/snmp/lustre-snmp-util.c b/snmp/lustre-snmp-util.c index 93908a1..70d5ecd 100644 --- a/snmp/lustre-snmp-util.c +++ b/snmp/lustre-snmp-util.c @@ -766,7 +766,7 @@ extern int mds_stats_values(char * name_value, unsigned long long * nb_sample, u void convert_ull(counter64 *c64, unsigned long long ull, size_t *var_len) { - *var_len = sizeof(c64); + *var_len = sizeof(*c64); c64->low = (unsigned long long) (0x0ffffffff & ull); ull >>= 32; c64->high = (unsigned long long) (0x0ffffffff & ull);