Complement va_start() with va_end() + minor style fixes in the same function.
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
{
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);
}
{
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);
}