[Openais] [PATCH 7/8] COVERITY 4: remove dead code in evs_dispatch()

Angus Salkeld angus.salkeld at gmail.com
Sat Oct 24 15:58:33 PDT 2009


322  			switch (dispatch_types) {
323  			case EVS_DISPATCH_ONE:

Event dead_error_condition: On this path, the condition "ignore_dispatch != 0" could not be true
Also see events: [dead_error_line][const][assignment][new_values]

324  				if (ignore_dispatch) {

Event dead_error_line: Cannot reach this line of code
Also see events: [dead_error_condition][const][assignment][new_values]

325  					ignore_dispatch = 0;
326  				} else {
327  					cont = 0;
328  				}
329  				break;
330  			case EVS_DISPATCH_ALL:

Event const: After this line, the value of "ignore_dispatch" is equal to 0
Event new_values: Conditional "ignore_dispatch != 0"
Also see events: [dead_error_line][dead_error_condition][assignment][new_values]

331  				if (ignore_dispatch) {
332  					ignore_dispatch = 0;
333  				}
334  				break;
335  			case EVS_DISPATCH_BLOCKING:
336  				break;
337  			}

Signed-off-by: Angus Salkeld <angus.salkeld at gmail.com>
---
  lib/evs.c |   18 ++----------------
  1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/lib/evs.c b/lib/evs.c
index bb18e65..01aa288 100644
--- a/lib/evs.c
+++ b/lib/evs.c
@@ -231,7 +231,6 @@ evs_error_t evs_dispatch (
  	struct res_evs_deliver_callback *res_evs_deliver_callback;
  	evs_callbacks_t callbacks;
  	coroipc_response_header_t *dispatch_data;
-	int ignore_dispatch = 0;

  	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
  	if (error != CS_OK) {
@@ -319,21 +318,8 @@ evs_error_t evs_dispatch (
  		/*
  		 * Determine if more messages should be processed
  		 * */
-		switch (dispatch_types) {
-		case EVS_DISPATCH_ONE:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			} else {
-				cont = 0;
-			}
-			break;
-		case EVS_DISPATCH_ALL:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			}
-			break;
-		case EVS_DISPATCH_BLOCKING:
-			break;
+		if (dispatch_types == EVS_DISPATCH_ONE) {
+			cont = 0;
  		}
  	} while (cont);

-- 
1.6.2.5


More information about the Openais mailing list