diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-05-06 20:17:31 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-05-19 10:42:17 -0400 |
| commit | f48f65d225ccf7a1ebd271b71dc0e755dac262f6 (patch) | |
| tree | f2913005cf5baf816a37aee20740432343cf3f19 | |
| parent | 79c5d9f3334fc72a4bcb349eb357c7319768bb88 (diff) | |
lib: Clean up some small static analysis warnings
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
| -rw-r--r-- | lib/checksum.c | 5 | ||||
| -rw-r--r-- | lib/thread.c | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/checksum.c b/lib/checksum.c index 43940b7155..116aaafc97 100644 --- a/lib/checksum.c +++ b/lib/checksum.c @@ -58,13 +58,10 @@ fletcher_checksum(u_char * buffer, const size_t len, const uint16_t offset) { u_int8_t *p; int x, y, c0, c1; - u_int16_t checksum; + u_int16_t checksum = 0; u_int16_t *csum; size_t partial_len, i, left = len; - checksum = 0; - - if (offset != FLETCHER_CHECKSUM_VALIDATE) /* Zero the csum in the packet. */ { diff --git a/lib/thread.c b/lib/thread.c index ab4764dfb1..ca54a44563 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -308,8 +308,7 @@ cpu_record_hash_print(struct hash_backet *bucket, struct vty *vty = args[1]; thread_type *filter = args[2]; struct cpu_thread_history *a = bucket->data; - - a = bucket->data; + if ( !(a->types & *filter) ) return; vty_out_cpu_thread_history(vty,a); @@ -417,8 +416,7 @@ cpu_record_hash_clear (struct hash_backet *bucket, { thread_type *filter = args; struct cpu_thread_history *a = bucket->data; - - a = bucket->data; + if ( !(a->types & *filter) ) return; |
