Skip to contentSkip to conversation

: Complement va_start() with va_end().

PATCH In review Richard Knutsson 2 participants 4 messages Nov 27, 2007 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Complement va_start() with va_end().

Complement va_start() with va_end().

---
Compile-tested on i386 with allyesconfig and allmodconfig.

drivers/media/video/saa5246a.c +6 -4
index ad02329..996b494 100644
@@ -187,12 +187,14 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
 {
 	unsigned char buf[64];
 	int v;
-	int ct=0;
+	int ct = 0;
 	va_list argp;
-	va_start(argp,t);
+	va_start(argp, t);
 
-	while((v=va_arg(argp,int))!=-1)
-		buf[ct++]=v;
+	while ((v = va_arg(argp, int)) != -1)
+		buf[ct++] = v;
+
+	va_end(argp);
 	return i2c_sendbuf(t, buf[0], ct-1, buf+1);
 }
 
drivers/media/video/saa5249.c +5 -3
index 94bb59a..da5ca30 100644
@@ -282,12 +282,14 @@ static int i2c_senddata(struct saa5249_device *t, ...)
 {
 	unsigned char buf[64];
 	int v;
-	int ct=0;
+	int ct = 0;
 	va_list argp;
 	va_start(argp,t);
 
-	while((v=va_arg(argp,int))!=-1)
-		buf[ct++]=v;
+	while ((v = va_arg(argp, int)) != -1)
+		buf[ct++] = v;
+
+	va_end(argp);
 	return i2c_sendbuf(t, buf[0], ct-1, buf+1);
 }
 
#1 lore raw
Quoted 12 lines · Richard Knutsson

Complement va_start() with va_end().

---
Compile-tested on i386 with allyesconfig and allmodconfig.

drivers/media/video/saa5246a.c +0 -0
index ad02329..996b494 100644

drivers/media/video/saa5246a.c static int i2c_senddata(struct saa5246a_device *t, ...) · line 192

Quoted 8 lines
drivers/media/video/saa5246a.c +2 -2
@@ -187,12 +187,14 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
 {
 	unsigned char buf[64];
 	int v;
-	int ct=0;
+	int ct = 0;
 	va_list argp;
-	va_start(argp,t);
+	va_start(argp, t);

Hi, Richard!

These are style fixes, and you did't mention this above. ;)

Thanks.

Cong

#2 lore raw

PATCH 1/1 : Complement va_start() with va_end() + style fixes

Complement va_start() with va_end() + minor style fixes in the same function.

---
Compile-tested on i386 with allyesconfig and allmodconfig. Thanks to WANG Cong for pointing out the missing 'style fix'-description.

saa5246a.c | 10 ++++++----
saa5249.c | 8 +++++---

2 files changed, 11 insertions(+), 7 deletions(-)
drivers/media/video/saa5246a.c +0 -0
index ad02329..996b494 100644
@@ -187,12 +187,14 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
{
	unsigned char buf[64];
	int v;
-	int ct=0;
+	int ct = 0;
	va_list argp;

- va_start(argp,t);
+ va_start(argp, t);

- while((v=va_arg(argp,int))!=-1)
- buf[ct++]=v;
+ while ((v = va_arg(argp, int)) != -1)
+ buf[ct++] = v;
+

+	va_end(argp);
	return i2c_sendbuf(t, buf[0], ct-1, buf+1);
}
drivers/media/video/saa5249.c +0 -0
index 94bb59a..da5ca30 100644
@@ -282,12 +282,14 @@ static int i2c_senddata(struct saa5249_device *t, ...)
{
	unsigned char buf[64];
	int v;
-	int ct=0;
+	int ct = 0;
	va_list argp;
	va_start(argp,t);

- while((v=va_arg(argp,int))!=-1)
- buf[ct++]=v;
+ while ((v = va_arg(argp, int)) != -1)
+ buf[ct++] = v;
+

+	va_end(argp);
	return i2c_sendbuf(t, buf[0], ct-1, buf+1);
}
#3 lore raw

Re: [PATCH] [VIDEO]: Complement va_start() with va_end() + style fixes

Please ignore the previous patch. Have resent it, but since my mail-client (Thunderbird) seem to be having a bad day, I had to use 'sendpatchset' and it can't continue on a thread.

Richard Knutsson