]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Clean up some small static analysis warnings
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 7 May 2016 00:17:31 +0000 (20:17 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 19 May 2016 14:42:17 +0000 (10:42 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
lib/checksum.c
lib/thread.c

index 43940b7155591d2996ea3e2664f90bce82831353..116aaafc975bf0143d85ea2c15d40cb543da701a 100644 (file)
@@ -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. */
     {
index ab4764dfb1ef0004f0d858b8c10188f849d2230d..ca54a445630fbf69f8ebfaf765b20857fde90996 100644 (file)
@@ -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;