Преглед изворни кода

totemconfig: Suppress coverity unused_value errors

All of unused_value error instances are actually example of good
defense programming style and removing them would make code worse and
less ready for future changes so add coverity specific comment
to suppress these errors.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse пре 11 месеци
родитељ
комит
105a3538f0
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 2 0
      exec/totempg.c
  2. 1 0
      lib/cpg.c

+ 2 - 0
exec/totempg.c

@@ -942,6 +942,7 @@ static int mcast_msg (
 			fragment_size += copy_len;
 			mcast_packed_msg_lens[mcast_packed_msg_count] += copy_len;
 			next_fragment = 1;
+			// coverity[UNUSED_VALUE:SUPPRESS] defensive programming
 			copy_len = 0;
 			copy_base = 0;
 			i++;
@@ -1011,6 +1012,7 @@ static int mcast_msg (
 			 * If the iovec all fit, go to the next iovec
 			 */
 			if ((copy_base + copy_len) == iovec[i].iov_len) {
+				// coverity[UNUSED_VALUE:SUPPRESS] defensive programming
 				copy_len = 0;
 				copy_base = 0;
 				i++;

+ 1 - 0
lib/cpg.c

@@ -499,6 +499,7 @@ cs_error_t cpg_dispatch (
 						qb_list_del (&assembly_data->list);
 						free(assembly_data->assembly_buf);
 						free(assembly_data);
+						// coverity[UNUSED_VALUE:SUPPRESS] defensive programming
 						assembly_data = NULL;
 					}