Fix mixed code/declarations compiler warnings/errors

Also removed duplicated loops

Change-Id: Ie8eefc8266e4efb23d320411c1a2cd2899e9137d
diff --git a/src/omap_driver.c b/src/omap_driver.c
index 94ef511..1e488b1 100644
--- a/src/omap_driver.c
+++ b/src/omap_driver.c
@@ -974,23 +974,16 @@
 OMAPEnterVT(VT_FUNC_ARGS_DECL)
 {
 	SCRN_INFO_PTR(arg);
-	int i;
-
-	for (i = 1; i < currentMaxClients; i++) {
-		if (clients[i])
-			AttendClient(clients[i]);
-	}
-
 	OMAPPtr pOMAP = OMAPPTR(pScrn);
-	int ret;
-
-	for (i = 1; i < currentMaxClients; i++) {
-		if (clients[i])
-			AttendClient(clients[i]);
-	}
+	int i, ret;
 
 	TRACE_ENTER();
 
+	for (i = 1; i < currentMaxClients; i++) {
+		if (clients[i])
+			AttendClient(clients[i]);
+	}
+
 	ret = drmSetMaster(pOMAP->drmFD);
 	if (ret) {
 		ERROR_MSG("Cannot get DRM master: %s", strerror(errno));
@@ -1017,23 +1010,16 @@
 OMAPLeaveVT(VT_FUNC_ARGS_DECL)
 {
 	SCRN_INFO_PTR(arg);
-	int i;
-
-	for (i = 1; i < currentMaxClients; i++) {
-		if (clients[i])
-			IgnoreClient(clients[i]);
-	}
-
 	OMAPPtr pOMAP = OMAPPTR(pScrn);
-	int ret;
-
-	for (i = 1; i < currentMaxClients; i++) {
-		if (clients[i])
-			IgnoreClient(clients[i]);
-	}
+	int i, ret;
 
 	TRACE_ENTER();
 
+	for (i = 1; i < currentMaxClients; i++) {
+		if (clients[i])
+			IgnoreClient(clients[i]);
+	}
+
 	ret = drmDropMaster(pOMAP->drmFD);
 	if (ret) {
 		WARNING_MSG("drmDropMaster failed: %s", strerror(errno));