[staging-next 4/5] staging/easycap: add first level indentation to easycap_testcard.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the first level indentation to easycap_testcard.c with astyle -t8.
No chackpatch warnings were created

Cc: Mike Thomas <rmthomas@xxxxxxxxxxx>
Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx>
---
 drivers/staging/easycap/easycap_testcard.c |  209 ++++++++++++++--------------
 1 files changed, 106 insertions(+), 103 deletions(-)

diff --git a/drivers/staging/easycap/easycap_testcard.c b/drivers/staging/easycap/easycap_testcard.c
index e3aa95f..9db26af 100644
--- a/drivers/staging/easycap/easycap_testcard.c
+++ b/drivers/staging/easycap/easycap_testcard.c
@@ -32,121 +32,124 @@
 void
 easycap_testcard(struct easycap *peasycap, int field)
 {
-int total;
-int y, u, v, r, g, b;
-unsigned char uyvy[4];
-int i1, line, k, m, n, more, much, barwidth, barheight;
-unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
-struct data_buffer *pfield_buffer;
+	int total;
+	int y, u, v, r, g, b;
+	unsigned char uyvy[4];
+	int i1, line, k, m, n, more, much, barwidth, barheight;
+	unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
+	struct data_buffer *pfield_buffer;
 
-if (NULL == peasycap) {
-	SAY("ERROR: peasycap is NULL\n");
-	return;
-}
-JOM(8, "%i=field\n", field);
-switch (peasycap->width) {
-case 720:
-case 360: {
-	barwidth = (2 * 720) / 8;
-	break;
-}
-case 704:
-case 352: {
-	barwidth = (2 * 704) / 8;
-	break;
-}
-case 640:
-case 320: {
-	barwidth = (2 * 640) / 8;
-	break;
-}
-default: {
-	SAM("ERROR:  cannot set barwidth\n");
-	return;
-}
-}
-if (TESTCARD_BYTESPERLINE < barwidth) {
-	SAM("ERROR: barwidth is too large\n");
-	return;
-}
-switch (peasycap->height) {
-case 576:
-case 288: {
-	barheight = 576;
-	break;
-}
-case 480:
-case 240: {
-	barheight = 480;
-	break;
-}
-default: {
-	SAM("ERROR: cannot set barheight\n");
-	return;
-}
-}
-total = 0;
-k = field;
-m = 0;
-n = 0;
+	if (NULL == peasycap) {
+		SAY("ERROR: peasycap is NULL\n");
+		return;
+	}
+	JOM(8, "%i=field\n", field);
+	switch (peasycap->width) {
+	case 720:
+	case 360: {
+		barwidth = (2 * 720) / 8;
+		break;
+	}
+	case 704:
+	case 352: {
+		barwidth = (2 * 704) / 8;
+		break;
+	}
+	case 640:
+	case 320: {
+		barwidth = (2 * 640) / 8;
+		break;
+	}
+	default: {
+		SAM("ERROR:  cannot set barwidth\n");
+		return;
+	}
+	}
+	if (TESTCARD_BYTESPERLINE < barwidth) {
+		SAM("ERROR: barwidth is too large\n");
+		return;
+	}
+	switch (peasycap->height) {
+	case 576:
+	case 288: {
+		barheight = 576;
+		break;
+	}
+	case 480:
+	case 240: {
+		barheight = 480;
+		break;
+	}
+	default: {
+		SAM("ERROR: cannot set barheight\n");
+		return;
+	}
+	}
+	total = 0;
+	k = field;
+	m = 0;
+	n = 0;
 
-for (line = 0;  line < (barheight / 2);  line++) {
-	for (i1 = 0;  i1 < 8;  i1++) {
-		r = (i1 * 256)/8;
-		g = (i1 * 256)/8;
-		b = (i1 * 256)/8;
+	for (line = 0;  line < (barheight / 2);  line++) {
+		for (i1 = 0;  i1 < 8;  i1++) {
+			r = (i1 * 256)/8;
+			g = (i1 * 256)/8;
+			b = (i1 * 256)/8;
 
-		y =  299*r/1000 + 587*g/1000 + 114*b/1000 ;
-		u = -147*r/1000 - 289*g/1000 + 436*b/1000 ;  u = u + 128;
-		v =  615*r/1000 - 515*g/1000 - 100*b/1000 ;  v = v + 128;
+			y =  299*r/1000 + 587*g/1000 + 114*b/1000 ;
+			u = -147*r/1000 - 289*g/1000 + 436*b/1000 ;
+			u = u + 128;
+			v =  615*r/1000 - 515*g/1000 - 100*b/1000 ;
+			v = v + 128;
 
-		uyvy[0] =  0xFF & u ;
-		uyvy[1] =  0xFF & y ;
-		uyvy[2] =  0xFF & v ;
-		uyvy[3] =  0xFF & y ;
+			uyvy[0] =  0xFF & u ;
+			uyvy[1] =  0xFF & y ;
+			uyvy[2] =  0xFF & v ;
+			uyvy[3] =  0xFF & y ;
 
-		p1 = &bfbar[0];
-		while (p1 < &bfbar[barwidth]) {
-			*p1++ = uyvy[0] ;
-			*p1++ = uyvy[1] ;
-			*p1++ = uyvy[2] ;
-			*p1++ = uyvy[3] ;
-			total += 4;
+			p1 = &bfbar[0];
+			while (p1 < &bfbar[barwidth]) {
+				*p1++ = uyvy[0] ;
+				*p1++ = uyvy[1] ;
+				*p1++ = uyvy[2] ;
+				*p1++ = uyvy[3] ;
+				total += 4;
 			}
 
-		p1 = &bfbar[0];
-		more = barwidth;
+			p1 = &bfbar[0];
+			more = barwidth;
 
-		while (more) {
-			if ((FIELD_BUFFER_SIZE/PAGE_SIZE) <= m) {
-				SAM("ERROR:  bad m reached\n");
-				return;
-			}
-		if (PAGE_SIZE < n) {
-			SAM("ERROR:  bad n reached\n"); return;
-		}
+			while (more) {
+				if ((FIELD_BUFFER_SIZE/PAGE_SIZE) <= m) {
+					SAM("ERROR:  bad m reached\n");
+					return;
+				}
+				if (PAGE_SIZE < n) {
+					SAM("ERROR:  bad n reached\n");
+					return;
+				}
 
-		if (0 > more) {
-			SAM("ERROR:  internal fault\n");
-			return;
-		}
+				if (0 > more) {
+					SAM("ERROR:  internal fault\n");
+					return;
+				}
 
-		much = PAGE_SIZE - n;
-		if (much > more)
-			much = more;
-		pfield_buffer = &peasycap->field_buffer[k][m];
-		p2 = pfield_buffer->pgo + n;
-		memcpy(p2, p1, much);
+				much = PAGE_SIZE - n;
+				if (much > more)
+					much = more;
+				pfield_buffer = &peasycap->field_buffer[k][m];
+				p2 = pfield_buffer->pgo + n;
+				memcpy(p2, p1, much);
 
-		p1 += much;
-		n += much;
-		more -= much;
-		if (PAGE_SIZE == n) {
-			m++;
-			n = 0;
+				p1 += much;
+				n += much;
+				more -= much;
+				if (PAGE_SIZE == n) {
+					m++;
+					n = 0;
+				}
 			}
 		}
 	}
-}
-return;
+	return;
 }
-- 
1.7.4

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux