msm: kgsl: Fix type0 packet parsing

The snapshot code was incorrectly parsing type0 packets in
indirect buffers which ended up with the snapshot code trying
to dump random values as valid GPU addresses.  There were other
failsafes in place to make sure we didn't actually try to read
the memory, but it still made for a incomplete snapshot and lots
of annoying error messages.

Change-Id: Ic0dedbad200ce0170a70c45a613e9717ff86658b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno_snapshot.c b/drivers/gpu/msm/adreno_snapshot.c
index ce73c68..bca7040 100644
--- a/drivers/gpu/msm/adreno_snapshot.c
+++ b/drivers/gpu/msm/adreno_snapshot.c
@@ -383,7 +383,7 @@
 	int offset = type0_pkt_offset(*ptr);
 	int i;
 
-	for (i = 0; i < (size + 1); i++, offset++) {
+	for (i = 0; i < size; i++, offset++) {
 
 		/* Visiblity stream buffer */
 
@@ -403,9 +403,9 @@
 			 * ...
 			 */
 
-			if (index % 3 == 0)
+			if ((index % 3) == 0)
 				vsc_pipe[index / 3].base = ptr[i + 1];
-			else if (index % 3 == 1)
+			else if ((index % 3) == 1)
 				vsc_pipe[index / 3].size = ptr[i + 1];
 		} else if ((offset >= A3XX_VFD_FETCH_INSTR_0_0) &&
 			(offset <= A3XX_VFD_FETCH_INSTR_1_F)) {
@@ -417,7 +417,7 @@
 			 * in between
 			 */
 
-			if (index % 2 == 0)
+			if ((index % 2) == 0)
 				vbo[index >> 1].stride =
 					(ptr[i + 1] >> 7) & 0x1FF;
 			else