test/usb_test/device_configuration.c: Format with clang-format
BRANCH=none
TEST=none
@@ -25,7 +25,8 @@ static void usage(int errs)
"Set/Get the USB Device Configuration value\n"
"\n"
"The default vid:pid is %04x:%04x\n"
- "\n", progname, vid, pid);
+ "\n",
+ progname, vid, pid);
exit(!!errs);
}
@@ -49,7 +50,6 @@ static void stupid_usb(const char *format, ...)
exit(1);
}
-
int main(int argc, char *argv[])
{
int r = 1;
@@ -111,8 +111,8 @@ int main(int argc, char *argv[])
r = libusb_init(NULL);
if (r) {
- printf("libusb_init() returned 0x%x: %s\n",
- r, libusb_error_name(r));
+ printf("libusb_init() returned 0x%x: %s\n", r,
+ libusb_error_name(r));
return 1;
}
@@ -122,13 +122,10 @@ int main(int argc, char *argv[])
stupid_usb("Can't open device %04x:%04x\n", vid, pid);
}
-
/* Set config*/
if (do_set) {
printf("SetCfg %d\n", setval);
- r = libusb_control_transfer(
- devh,
- 0x00, /* bmRequestType */
+ r = libusb_control_transfer(devh, 0x00, /* bmRequestType */
0x09, /* bRequest */
setval, /* wValue */
0x0000, /* wIndex */
@@ -137,16 +134,14 @@ int main(int argc, char *argv[])
1000); /* timeout (ms) */
if (r < 0)
- printf("transfer returned 0x%x %s\n",
- r, libusb_error_name(r));
+ printf("transfer returned 0x%x %s\n", r,
+ libusb_error_name(r));
}
/* Get config */
memset(buf, 0, sizeof(buf));
- r = libusb_control_transfer(
- devh,
- 0x80, /* bmRequestType */
+ r = libusb_control_transfer(devh, 0x80, /* bmRequestType */
0x08, /* bRequest */
0x0000, /* wValue */
0x0000, /* wIndex */
@@ -155,8 +150,8 @@ int main(int argc, char *argv[])
1000); /* timeout (ms) */
if (r <= 0)
- stupid_usb("GetCfg transfer() returned 0x%x %s\n",
- r, libusb_error_name(r));
+ stupid_usb("GetCfg transfer() returned 0x%x %s\n", r,
+ libusb_error_name(r));
printf("GetCfg returned %d bytes:", r);
for (i = 0; i < r; i++)
