All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Mike Isely <isely@pobox.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/6] [media] pvrusb2: fix camel case variables
Date: Sat, 26 Mar 2011 01:53:49 +0000	[thread overview]
Message-ID: <20110326015349.GI2008@bicker> (raw)

This patch renames some variables to bring them more in line with
kernel CodingStyle.

arrPtr  => arr
arrSize => arr_size
bufPtr  => buf
bufSize => buf_size

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c
index b214f77..d5a679f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-std.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-std.c
@@ -115,26 +115,26 @@ static const struct std_name std_items[] = {
  * Search an array of std_name structures and return a pointer to the
  * element with the matching name.
  */
-static const struct std_name *find_std_name(const struct std_name *arrPtr,
-					    unsigned int arrSize,
-					    const char *bufPtr,
-					    unsigned int bufSize)
+static const struct std_name *find_std_name(const struct std_name *arr,
+					    unsigned int arr_size,
+					    const char *buf,
+					    unsigned int buf_size)
 {
 	unsigned int idx;
 	const struct std_name *p;
 
-	for (idx = 0; idx < arrSize; idx++) {
-		p = arrPtr + idx;
-		if (strlen(p->name) != bufSize)
+	for (idx = 0; idx < arr_size; idx++) {
+		p = arr + idx;
+		if (strlen(p->name) != buf_size)
 			continue;
-		if (!memcmp(bufPtr, p->name, bufSize))
+		if (!memcmp(buf, p->name, buf_size))
 			return p;
 	}
 	return NULL;
 }
 
-int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
-		       unsigned int bufSize)
+int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
+		       unsigned int buf_size)
 {
 	v4l2_std_id id = 0;
 	v4l2_std_id cmsk = 0;
@@ -144,27 +144,27 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 	char ch;
 	const struct std_name *sp;
 
-	while (bufSize) {
+	while (buf_size) {
 		if (!mMode) {
 			cnt = 0;
-			while ((cnt < bufSize) && (bufPtr[cnt] != '-'))
+			while ((cnt < buf_size) && (buf[cnt] != '-'))
 				cnt++;
-			if (cnt >= bufSize)
+			if (cnt >= buf_size)
 				return 0; /* No more characters */
 			sp = find_std_name(std_groups, ARRAY_SIZE(std_groups),
-					   bufPtr, cnt);
+					   buf, cnt);
 			if (!sp)
 				return 0; /* Illegal color system name */
 			cnt++;
-			bufPtr += cnt;
-			bufSize -= cnt;
+			buf += cnt;
+			buf_size -= cnt;
 			mMode = !0;
 			cmsk = sp->id;
 			continue;
 		}
 		cnt = 0;
-		while (cnt < bufSize) {
-			ch = bufPtr[cnt];
+		while (cnt < buf_size) {
+			ch = buf[cnt];
 			if (ch = ';') {
 				mMode = 0;
 				break;
@@ -174,7 +174,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 			cnt++;
 		}
 		sp = find_std_name(std_items, ARRAY_SIZE(std_items),
-				   bufPtr, cnt);
+				   buf, cnt);
 		if (!sp)
 			return 0; /* Illegal modulation system ID */
 		t = sp->id & cmsk;
@@ -182,10 +182,10 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 			return 0; /* Specific color + modulation system
 				     illegal */
 		id |= t;
-		if (cnt < bufSize)
+		if (cnt < buf_size)
 			cnt++;
-		bufPtr += cnt;
-		bufSize -= cnt;
+		buf += cnt;
+		buf_size -= cnt;
 	}
 
 	if (idPtr)
@@ -193,7 +193,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 	return !0;
 }
 
-unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
+unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
 				v4l2_std_id id)
 {
 	unsigned int idx1, idx2;
@@ -212,26 +212,26 @@ unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
 				continue;
 			if (!gfl) {
 				if (cfl) {
-					c2 = scnprintf(bufPtr, bufSize, ";");
+					c2 = scnprintf(buf, buf_size, ";");
 					c1 += c2;
-					bufSize -= c2;
-					bufPtr += c2;
+					buf_size -= c2;
+					buf += c2;
 				}
 				cfl = !0;
-				c2 = scnprintf(bufPtr, bufSize,
+				c2 = scnprintf(buf, buf_size,
 					       "%s-", gp->name);
 				gfl = !0;
 			} else {
-				c2 = scnprintf(bufPtr, bufSize, "/");
+				c2 = scnprintf(buf, buf_size, "/");
 			}
 			c1 += c2;
-			bufSize -= c2;
-			bufPtr += c2;
-			c2 = scnprintf(bufPtr, bufSize,
+			buf_size -= c2;
+			buf += c2;
+			c2 = scnprintf(buf, buf_size,
 				       ip->name);
 			c1 += c2;
-			bufSize -= c2;
-			bufPtr += c2;
+			buf_size -= c2;
+			buf += c2;
 		}
 	}
 	return c1;

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Mike Isely <isely@pobox.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/6] [media] pvrusb2: fix camel case variables
Date: Sat, 26 Mar 2011 04:53:49 +0300	[thread overview]
Message-ID: <20110326015349.GI2008@bicker> (raw)

This patch renames some variables to bring them more in line with
kernel CodingStyle.

arrPtr  => arr
arrSize => arr_size
bufPtr  => buf
bufSize => buf_size

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c
index b214f77..d5a679f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-std.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-std.c
@@ -115,26 +115,26 @@ static const struct std_name std_items[] = {
  * Search an array of std_name structures and return a pointer to the
  * element with the matching name.
  */
-static const struct std_name *find_std_name(const struct std_name *arrPtr,
-					    unsigned int arrSize,
-					    const char *bufPtr,
-					    unsigned int bufSize)
+static const struct std_name *find_std_name(const struct std_name *arr,
+					    unsigned int arr_size,
+					    const char *buf,
+					    unsigned int buf_size)
 {
 	unsigned int idx;
 	const struct std_name *p;
 
-	for (idx = 0; idx < arrSize; idx++) {
-		p = arrPtr + idx;
-		if (strlen(p->name) != bufSize)
+	for (idx = 0; idx < arr_size; idx++) {
+		p = arr + idx;
+		if (strlen(p->name) != buf_size)
 			continue;
-		if (!memcmp(bufPtr, p->name, bufSize))
+		if (!memcmp(buf, p->name, buf_size))
 			return p;
 	}
 	return NULL;
 }
 
-int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
-		       unsigned int bufSize)
+int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *buf,
+		       unsigned int buf_size)
 {
 	v4l2_std_id id = 0;
 	v4l2_std_id cmsk = 0;
@@ -144,27 +144,27 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 	char ch;
 	const struct std_name *sp;
 
-	while (bufSize) {
+	while (buf_size) {
 		if (!mMode) {
 			cnt = 0;
-			while ((cnt < bufSize) && (bufPtr[cnt] != '-'))
+			while ((cnt < buf_size) && (buf[cnt] != '-'))
 				cnt++;
-			if (cnt >= bufSize)
+			if (cnt >= buf_size)
 				return 0; /* No more characters */
 			sp = find_std_name(std_groups, ARRAY_SIZE(std_groups),
-					   bufPtr, cnt);
+					   buf, cnt);
 			if (!sp)
 				return 0; /* Illegal color system name */
 			cnt++;
-			bufPtr += cnt;
-			bufSize -= cnt;
+			buf += cnt;
+			buf_size -= cnt;
 			mMode = !0;
 			cmsk = sp->id;
 			continue;
 		}
 		cnt = 0;
-		while (cnt < bufSize) {
-			ch = bufPtr[cnt];
+		while (cnt < buf_size) {
+			ch = buf[cnt];
 			if (ch == ';') {
 				mMode = 0;
 				break;
@@ -174,7 +174,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 			cnt++;
 		}
 		sp = find_std_name(std_items, ARRAY_SIZE(std_items),
-				   bufPtr, cnt);
+				   buf, cnt);
 		if (!sp)
 			return 0; /* Illegal modulation system ID */
 		t = sp->id & cmsk;
@@ -182,10 +182,10 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 			return 0; /* Specific color + modulation system
 				     illegal */
 		id |= t;
-		if (cnt < bufSize)
+		if (cnt < buf_size)
 			cnt++;
-		bufPtr += cnt;
-		bufSize -= cnt;
+		buf += cnt;
+		buf_size -= cnt;
 	}
 
 	if (idPtr)
@@ -193,7 +193,7 @@ int pvr2_std_str_to_id(v4l2_std_id *idPtr, const char *bufPtr,
 	return !0;
 }
 
-unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
+unsigned int pvr2_std_id_to_str(char *buf, unsigned int buf_size,
 				v4l2_std_id id)
 {
 	unsigned int idx1, idx2;
@@ -212,26 +212,26 @@ unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
 				continue;
 			if (!gfl) {
 				if (cfl) {
-					c2 = scnprintf(bufPtr, bufSize, ";");
+					c2 = scnprintf(buf, buf_size, ";");
 					c1 += c2;
-					bufSize -= c2;
-					bufPtr += c2;
+					buf_size -= c2;
+					buf += c2;
 				}
 				cfl = !0;
-				c2 = scnprintf(bufPtr, bufSize,
+				c2 = scnprintf(buf, buf_size,
 					       "%s-", gp->name);
 				gfl = !0;
 			} else {
-				c2 = scnprintf(bufPtr, bufSize, "/");
+				c2 = scnprintf(buf, buf_size, "/");
 			}
 			c1 += c2;
-			bufSize -= c2;
-			bufPtr += c2;
-			c2 = scnprintf(bufPtr, bufSize,
+			buf_size -= c2;
+			buf += c2;
+			c2 = scnprintf(buf, buf_size,
 				       ip->name);
 			c1 += c2;
-			bufSize -= c2;
-			bufPtr += c2;
+			buf_size -= c2;
+			buf += c2;
 		}
 	}
 	return c1;

             reply	other threads:[~2011-03-26  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26  1:53 Dan Carpenter [this message]
2011-03-26  1:53 ` [PATCH 4/6] [media] pvrusb2: fix camel case variables Dan Carpenter
2011-03-26  4:35 ` Mike Isely
2011-03-26  4:35   ` Mike Isely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110326015349.GI2008@bicker \
    --to=error27@gmail.com \
    --cc=isely@pobox.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.