Commit 6b658153 authored by Fabio Utzig's avatar Fabio Utzig
Browse files

Coding style fixes

parent ca6cb63d
...@@ -491,8 +491,7 @@ enum flasher_error { ...@@ -491,8 +491,7 @@ enum flasher_error {
}; };
static static enum flasher_error
enum flasher_error
flasher_find_matching_device( flasher_find_matching_device(
libusb_context *ctx, libusb_context *ctx,
libusb_device **matching_device_out, libusb_device **matching_device_out,
...@@ -513,7 +512,7 @@ flasher_find_matching_device( ...@@ -513,7 +512,7 @@ flasher_find_matching_device(
int device_count; int device_count;
int device_index; int device_index;
/* Enumberate all USB devices */ /* Enumerate all USB devices */
retval = libusb_get_device_list(ctx, &device_list); retval = libusb_get_device_list(ctx, &device_list);
if (retval < 0) { if (retval < 0) {
libusb_error = retval; libusb_error = retval;
...@@ -597,9 +596,7 @@ out: ...@@ -597,9 +596,7 @@ out:
} }
static static void flasher_usage()
void
flasher_usage()
{ {
printf("usage: lm4flash [-v] [-s serial] <binary-file>\n"); printf("usage: lm4flash [-v] [-s serial] <binary-file>\n");
printf("\t-v - Enables verification after write\n"); printf("\t-v - Enables verification after write\n");
...@@ -607,13 +604,7 @@ flasher_usage() ...@@ -607,13 +604,7 @@ flasher_usage()
} }
static static int flasher_flash(const char *serial, const char *rom_name)
int
flasher_flash(
int do_verify,
const char *serial,
const char *rom_name
)
{ {
libusb_context *ctx = NULL; libusb_context *ctx = NULL;
libusb_device *device = NULL; libusb_device *device = NULL;
...@@ -705,10 +696,12 @@ int main(int argc, char *argv[]) ...@@ -705,10 +696,12 @@ int main(int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
if (optind >= argc) { if (optind >= argc) {
flasher_usage(); flasher_usage();
return EXIT_FAILURE; return EXIT_FAILURE;
} else } else
rom_name = argv[optind]; rom_name = argv[optind];
return flasher_flash(do_verify, serial, rom_name);
return flasher_flash(serial, rom_name);
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment