[PATCH 2/6] staging: dgap: fep5.c: removes smatch warning "missing break? reassigning 'ch->pscan_state'"

Lidza Louina lidza.louina at gmail.com
Mon Sep 23 22:47:13 UTC 2013


This patch removes this smatch warning:
warn: missing break? reassigning 'ch->pscan_state'

Signed-off-by: Lidza Louina <lidza.louina at gmail.com>
---
 drivers/staging/dgap/dgap_fep5.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/dgap/dgap_fep5.c b/drivers/staging/dgap/dgap_fep5.c
index 4464f02..29de349 100644
--- a/drivers/staging/dgap/dgap_fep5.c
+++ b/drivers/staging/dgap/dgap_fep5.c
@@ -1587,10 +1587,6 @@ void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned char *
 	while (l--) {
 		c = *in++;
 		switch (ch->pscan_state) {
-		default:
-			/* reset to sanity and fall through */
-			ch->pscan_state = 0;
-
 		case 0:
 			/* No FF seen yet */
 			if (c == (unsigned char) '\377') {
@@ -1642,6 +1638,11 @@ void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, unsigned char *
 
 			count += 1;
 			ch->pscan_state = 0;
+			break;
+		default:
+			/* reset to sanity and fall through */
+			ch->pscan_state = 0;
+			break;
 		}       
 	}
 	*len = count;
-- 
1.8.1.2



More information about the devel mailing list