diff options
author | Dominic Sacré <dominic.sacre@gmx.de> | 2015-05-11 17:49:43 +0200 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2015-05-19 13:54:51 +0200 |
commit | 9b02f79a280e41b133cb45ff8bb45a84a052cd12 (patch) | |
tree | f5365d316b9d6274d294ce44031d04f282d2929c | |
parent | 23376bbaca25d910d0b85cbcfacc020f4eaf78c0 (diff) | |
download | libusbg-9b02f79a280e41b133cb45ff8bb45a84a052cd12.tar.gz libusbg-9b02f79a280e41b133cb45ff8bb45a84a052cd12.tar.bz2 libusbg-9b02f79a280e41b133cb45ff8bb45a84a052cd12.zip |
libusbg: Format switch statements more consistently
Insert blank lines between all cases in switch statements that branch
on attribute types.
Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rw-r--r-- | examples/show-gadgets.c | 4 | ||||
-rw-r--r-- | src/usbg.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/show-gadgets.c b/examples/show-gadgets.c index aa4275c..7ff71d5 100644 --- a/examples/show-gadgets.c +++ b/examples/show-gadgets.c @@ -104,6 +104,7 @@ void show_function(usbg_function *f) fprintf(stdout, " Function, type: %s instance: %s\n", usbg_get_function_type_str(type), instance); + switch (f_attrs.header.attrs_type) { case USBG_F_ATTRS_SERIAL: fprintf(stdout, " port_num\t\t%d\n", @@ -122,6 +123,7 @@ void show_function(usbg_function *f) fprintf(stdout, " qmult\t\t%d\n", f_net_attrs->qmult); break; } + case USBG_F_ATTRS_PHONET: fprintf(stdout, " ifname\t\t%s\n", f_attrs.attrs.phonet.ifname); break; @@ -129,6 +131,7 @@ void show_function(usbg_function *f) case USBG_F_ATTRS_FFS: fprintf(stdout, " dev_name\t\t%s\n", f_attrs.attrs.ffs.dev_name); break; + case USBG_F_ATTRS_MS: { usbg_f_ms_attrs *attrs = &f_attrs.attrs.ms; @@ -146,6 +149,7 @@ void show_function(usbg_function *f) } break; } + default: fprintf(stdout, " UNKNOWN\n"); } @@ -1093,6 +1093,7 @@ static int usbg_parse_function_attrs(usbg_function *f, ret = USBG_SUCCESS; break; } + case USBG_F_ATTRS_MS: f_attrs->header.attrs_type = USBG_F_ATTRS_MS; ret = usbg_parse_function_ms_attrs(f, &(f_attrs->attrs.ms)); @@ -2898,6 +2899,7 @@ void usbg_cleanup_function_attrs(usbg_function_attrs *f_attrs) free(attrs->ffs.dev_name); attrs->ffs.dev_name = NULL; break; + case USBG_F_ATTRS_MS: { int i; @@ -2919,6 +2921,7 @@ void usbg_cleanup_function_attrs(usbg_function_attrs *f_attrs) ms_break: break; } + default: ERROR("Unsupported attrs type\n"); break; @@ -3162,9 +3165,11 @@ int usbg_set_function_attrs(usbg_function *f, ret = f_attrs->attrs.ffs.dev_name && f_attrs->attrs.ffs.dev_name[0] ? USBG_ERROR_INVALID_PARAM : USBG_SUCCESS; break; + case USBG_F_ATTRS_MS: ret = usbg_set_function_ms_attrs(f, &f_attrs->attrs.ms); break; + default: ERROR("Unsupported function type\n"); ret = USBG_ERROR_NOT_SUPPORTED; |