please review attached patch
From 7f31259bfc6a86a1beae56c612984c1d4c6b7569 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Fri, 23 Mar 2018 17:41:48 +0500
Subject: [PATCH] CLEANUP: map, stream:  remove duplicate code in src/map.c,
 src/stream.c

issue was identified by cppcheck

[src/map.c:372] -> [src/map.c:376]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/map.c:433] -> [src/map.c:437]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/map.c:555] -> [src/map.c:559]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?
[src/stream.c:3264] -> [src/stream.c:3268]: (warning) Variable 'appctx->st2' is reassigned a value before the old one has been used. 'break;' missing?

Signed-off-by: Ilya Shipitsin <[email protected]>
---
 src/map.c    | 3 ---
 src/stream.c | 1 -
 2 files changed, 4 deletions(-)

diff --git a/src/map.c b/src/map.c
index fb411732..9313dc87 100644
--- a/src/map.c
+++ b/src/map.c
@@ -369,7 +369,6 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
 			appctx->ctx.map.bref.ref = elt->list.n;
 		}
 		HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-		appctx->st2 = STAT_ST_FIN;
 		/* fall through */
 
 	default:
@@ -430,7 +429,6 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
 			                                        appctx->ctx.map.display_flags);
 		}
 
-		appctx->st2 = STAT_ST_FIN;
 		/* fall through */
 
 	default:
@@ -552,7 +550,6 @@ static int cli_io_handler_map_lookup(struct appctx *appctx)
 			                                         &appctx->ctx.map.ref->pat);
 		}
 		HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
-		appctx->st2 = STAT_ST_FIN;
 		/* fall through */
 
 	default:
diff --git a/src/stream.c b/src/stream.c
index 38d72400..2d8f2783 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -3261,7 +3261,6 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
 		}
 
 		HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);
-		appctx->st2 = STAT_ST_FIN;
 		/* fall through */
 
 	default:
-- 
2.14.3

Reply via email to